diff --git a/admin/action-hook.php b/admin/action-hook.php index 71bc0864..cef07d69 100644 --- a/admin/action-hook.php +++ b/admin/action-hook.php @@ -40,7 +40,7 @@ function wpt_admin_form_top(){ } } } -add_action( 'wpto_form_top', 'wpt_admin_form_top'); +// add_action( 'wpto_form_top', 'wpt_admin_form_top'); if( !function_exists( 'wpt_ctrl_s_text_at_top' ) ){ @@ -122,63 +122,151 @@ function wpt_configure_basic_part( $settings,$current_config_value,$field_name ) // var_dump($page); ?> -
-

- - - - - - - - - - - +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + - - - - - + - - - - + + + + - + + + + + + + + + - - - - - - - + + + + + + - + + + + + - - - + - - - - - - - - - + + + + + - - - + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + - - - - - - - - - - - - - - + + + - - - - - + + + + + + - - - - -
+
+

+
+ +
+
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +

+
+
+
+
+

+
+
+ +
+
+
+
+ +
+
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+
+
+
+ +
+
- -
+ + + +
+ +
+
+
+
+ +
+
- -
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
- - -
+
+
+
+

+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
- -
+
+ +

You can sort mini filter's option by assending or descending. It's a minimal feature. When user showing all product in a table and there is no pagination. Then user can use Mini Filter.

+
+
+
+
+
+ +
+
-

- Tips: - If set Default Sorting, Taxonomy (Category/Tag) sorting will be like Default Taxonomy list. -

-
- - -

-
- + + + +
+ +

It's for Advance Search Drop-Down sorting. Advance Search box is important, when you created your table with pagination. or when you want that, search will execute from whole site.

+

If set Default Sorting, Taxonomy (Category/Tag) sorting will be like Default Taxonomy list.

+
+
+
+
+ +
+
+ -
- + + + + + + +
+ +

It's a minimal feature. When user showing all product in a table and there is no pagination. Then user can use Instance Search input box.

+
+
+
+
+ +
+
+ +
+
+
+
+

For Instance search box, you can change placeholder text.

+
+
+
+
+

+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
-
+ + + + +
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+
+
+

+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+
+
+ +
+
-

-
+ + + + +
+ +

+
+
+
+
+ +
+
+ +
+
+
+
+

Direct Checkout Page[for Add to cart Selected]

-
- -
- -

-
+ +
+
+
+ +
+
-
+ + + + +
+ +
+
+
+
+ +
+
+
+
+
+
+ +
+
- -
+
+ +
-
-

- - - - - + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + - + + + + + - - - + + + + + + - + + + + + + + + + - - - + - - - - - + + + + + - - - - - - - - - - - - + - - - - - - - - - - - + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + - + + + + - - - + + + + + - - - - + + + + + + + + - - - - - + + + + + + + - - - - - + + + + + - - - - + + + + + - - - - + + + + - - -
+
+

+
+ +
+
+
+
+
+ +
+
-
+
+

When products not found in table based on your query.

+
+
+
+
+
+ +
+
+ +
+
+
+
+

Specially for Short Message column. It's a placeholder text of Short Message Input box. To enable Short Message - Please enable this collumn from Table Edit page.

+
+
+
+
+ +
+
-

-
+
+

+ + +

+
+
+
+
+ +
+
+ +
+
+
+
+

When select infinite scrol for pagination option, there will show a Loading button. Change text from here.

+
+
+
+
+
+ +
+
-
- -
+
+

It's not visible to table. Hidden by css.

+
+
- -
- -
+ + +
+
+
+ +
+
-
- -
- -
+
+

Empty cart button text change for Woo Product Table's mini cart. Min Cart can show/hide from Options table from Product Table Edit page.

+
+
- -
- -
+ +
+
+
+

+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
-
+
+

If user enable checkbox for a table, then a Add To Cart Selected button at the top of table.

+
+
+
+
+ +
+
+ +
+
+
+
+

It's for Add to cart Selected button. If user enable checkbox for a table, then a Add To Cart Selected button at the top of table.

+
+
+
+
+ +
+
+ +
+
+
+
+

It's for Add to cart Selected button. If user enable checkbox for a table, then a Add To Cart Selected button at the top of table.

+
+
+ +
+
+
+

+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
-
+ + + +
+

Advance Search Box area title. Showing at the top of main search box.

+
+
+
+
+ +
+
+ +
+
+
+
+

Label/Title text of Search Input box of Advance Search area. Not a placeholder of inpux. It's label.

+
+
+
+
+ +
+
-
+ + + +
+

Advance search box - Placeholder of input box.

+
+
+
+
+ +
+
-
+ + + +
+

SearchBox Sale text

+
+
+
+
+ +
+
-
+ + + +
+ +
+
+
+
+ +
+
-
+ + + +
+ +
+
+
+
+ +
+
-
-
+ + +
+
+ +
+
+
+
+

+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+

Mini Filter - label text. Remember: Mini Filter only for Visible product. It's a minmal feature.

+
+
+
+
+ +
+
+ +
+
+
+
+

Reset button text of Mini-Filter. Remember: Mini Filter only for Visible product. It's a minmal feature.

+
+
+ +
+ -
-

', '' );?>

- - - - - + + + +
+
+ + + + + + + + + + - - - - - + + + + + - - - - + + + + + - - - - + + + + - - - - + + + + + - - -
+
+

', '' );?>

+
+ +
+
+
+
+
+ +
+
-

', '' ); ?>

-
+ + + +
+

', '' ); ?>

+
+
+
+
+ +
+
-
+ + + +
+ +
+
+
+
+ +
+
-
+ + + +
+ +
+
+
+
+ +
+
-
+ + + +
+ +
+
+
+
+ +
+
-
-
+ + +
+
+ +
+
+
-
-

', '' );?>

- - - - - - - - - - - - - - - - - -
- -
- -
- -
-
- -
-

- - - - - + + + + + +
+
+ + + + + + + + + + + - - - - + + + + + - - - - + + + + - - - - + + + + + - - - - + + + + + - - - - - - - - + + + + + + + + + + - - - - + + + + + - - - - + + + + + - - - - + + + + + - - - - - - -
+
+

+
+ +
+
+
+
+
+ +
+
-
+ + + +
+

For vairable product, If you change drop-down of Variation and Not available variation. Then this message will show.

+
+
+
+
+ +
+
-
+ + + +
+ For variable product, if not set properly variation. May be: price is not inputted. may be: Out of Stock. +
+
+
+
+ +
+
-
+ + + +
+ +
+
+
+
+ +
+
-
+ + + +
+ For vairable product, If user click on Add to cart button without select any variation. Then this message will show. +
+
+
+
+ +
+
-
- -
+ + + +
+ +
+
+
+
+ +
+
+ +
+
+
+
+

Actually it's for pagination. When select Load More button or infinite scroll. If not found product on nect load more clik.

+
+
+
+
+ +
+
-
+ + + +
+

If user click again same add to cart button before complete added.

+
+
+
+
+ +
+
-
+ + + +
+

It's for variable product. If not match variation, of if not found variation.

+
+
+
+
+ +
+
-
+ + + +
+

It's actually for variable product. If product has one more type variation, and if not match on available. this message will show.

+
+
+
+
+ +
+
-
- -
-
+ + +
+
+ +
+
+
+ @@ -723,31 +1439,39 @@ function wpt_extra_field_for_disc_limit( $_device_name, $column_settings ){ if( !function_exists( 'wpt_tawkto_code_header' ) ){ /** - * set class for Admin Body tag + * tawk.to Chatbox Added and + * condition applied * - * @param type $classes * @return String */ - function wpt_tawkto_code_header( $class_string ){ + function wpt_tawkto_code_header(){ global $current_screen; $s_id = isset( $current_screen->id ) ? $current_screen->id : ''; - if( strpos( $s_id, 'wpt') !== false ){ + if( strpos( $s_id, 'wpt') === false ) return; + $temp_permission = false; + $submitted = filter_input_array(INPUT_POST); + if( isset( $submitted['data'] ) ){ + if(isset( $submitted['data']['disable_live_support'] )) return; + $temp_permission = true; + } + $disable_live_support = $temp_permission ? false : wpt_get_config('disable_live_support'); + if( $disable_live_support ) return; ?> - - - + + + */ if( !function_exists( 'wpto_admin_configuration_form_top_free' ) ){ function wpto_admin_configuration_form_top_free($settings,$current_config_value){ if( !isset( $settings['page'] ) || isset( $settings['page'] ) && $settings['page'] != 'configuration_page' ){ return; } - + $user_can_edit = wpt_user_can_edit() ? 'user_can_edit' : 'user_can_not_edit'; + $is_pro = ! empty( $settings['module'] ) && $settings['module'] == 'pro_version' ? true : false; + /** + * Now Here Available is: + * $Page_Loader + * which is represent Page_Loader classes's Object. + * we used $Page_Loader->is_pro + * in this function specially to show or hide divider-row + */ + ?> - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- - - + + + + + + + + + + - - - - + + + + + + - - - - + + + + + + + + + + + + + + +
+
+
+

Sort and Footer Cart

+
+
+ +
+
+
+
+ +
+
+
+
+ +
+

Tips: - If you want to sort any column like number where text like: 1st,2nd,3rd,4th. To this situation, add a custom tag className text_with_number for column. Helper doc + If you want to sort any column like number where text like: 1st,2nd,3rd,4th. To this situation, add a custom tag className text_with_number for column.

- -
+
+
+ +
+
+ -

+
+
+
+
+

+
+
+
+
+

Chat Area (Optional)

+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +

You can Disable/Off Chatbox. Live Support chatbox are showing in your dashboard at right bottom corner. If you need any help, Just knock over there.

+
+
+ + + + + + -
+
+
+ +
+
+ +
+ +
+
+
+
+ Helper doc +

Enable Table on Archive Page. Such as: Archive Page, Tag Page, Taxonomy Page. First Select a table and check [On] to show in shop/archive page.

+

+ Notice: + Product table will display products according to WooCommerce default query and Advance Search box is not available on Archive page. +

+
- - +
+
+
+ +
+
+ +
+
+
+
+ Helper doc +

You Can turn on/off table view switcher on shop page

+
+
+
+
+

For Variable Products

+
+
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+ Helper doc +

Select a table and enable above the button to show a variation table on every variable product page which will replace the default variation dropdown select options.

+
+
+
+
+ +
+
+ +
+
+
+
+ Helper doc +

Select a table position to show the table to your desire place!

+
+
+
+
+ +
+
+ +
+
+ +
+
+
+
+

Input product ids. If you have more then one products, sepetare them with coma(,).

+
+
+
+
+

Advance

+
+
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+

Only if found issue on Advance Search, Check it

+
+
+
+
+ +
+
+ +
+
+
+
+ Helper doc +

Cascade filter will be added to product search filter

+
+
+
+
+ +
+
+ +
+
+
+
+ Helper doc +

Show or hide the restricted column for guest user.

+
+
+ + run(); + + + $deactive_form = new Deactive_Form(); $deactive_form->run(); + /** + * This is only for Notice for pro user, + * Actually on free version and pro version combination + * need min request pro for latest free version, + * that's why, we have added this notice. + */ $pro_update_ntc = new Pro_Version_Update(); $pro_update_ntc->run(); $features = new Feature_Loader(); $features->run(); + + add_action('admin_init', [$this, 'admin_init']); + } + + public function admin_init(){ + + $tracker = new Tracker(); + $tracker->run(); + } } \ No newline at end of file diff --git a/admin/configuration_page.php b/admin/configuration_page.php index 8a135e65..aa3b0839 100644 --- a/admin/configuration_page.php +++ b/admin/configuration_page.php @@ -1,6 +1,6 @@ -
+ 'wpt_product_table', 'date_query' => array( - 'before' => '2022-3-15' + 'before' => '2022-3-15' //2022-3-15 //2014-3-15 ), ); @@ -142,7 +142,7 @@ function wpt_datewise_validation(){ $query = new WP_Query( $args ); $total = $query->found_posts; - return $total <= 2; //Limitation upto 4 //limitation has changed upto 2 + return $total <= 0; //Limitation upto 2 //limitation has changed upto 0 } /** @@ -399,7 +399,7 @@ function wpt_add_tabs(){ } } -add_action( 'current_screen', 'wpt_add_tabs', 50 ); +// add_action( 'current_screen', 'wpt_add_tabs', 50 ); function wpt_social_links(){ ?> diff --git a/admin/handle/feature-loader.php b/admin/handle/feature-loader.php index 3faeb023..08a30623 100644 --- a/admin/handle/feature-loader.php +++ b/admin/handle/feature-loader.php @@ -18,6 +18,13 @@ class Feature_Loader { public function run() { + /** + * It's Admin panel Table's Action column feature + * Actually adding third-party plugin supported feature + * checkbox added by this Class/Object. + * + * @author Saiful Islam + */ $action = new Action_Feature(); $action->run(); } diff --git a/admin/handle/plugin-deactive/deactive-form.php b/admin/handle/plugin-deactive/deactive-form.php index be923e90..e100edac 100644 --- a/admin/handle/plugin-deactive/deactive-form.php +++ b/admin/handle/plugin-deactive/deactive-form.php @@ -89,7 +89,7 @@ class Deactive_Form protected $assignScreen = false; protected $screen; protected $screenID; - public $dev_version = '1.0.0'; + public $dev_version = WPT_DEV_VERSION; protected $form_top_message; @@ -211,6 +211,11 @@ public function form() $site_url = get_site_url(); $blog_name = get_bloginfo( 'name' ); $plugin_name = $this->data['name'] ?? 'CA Plugin'; + $email = ''; + if(function_exists('wp_get_current_user')){ + $current_user = wp_get_current_user(); + // $email = $current_user->user_email; //Has been removed + } ?>
@@ -231,11 +236,15 @@ public function form()

For support queries Submit Ticket

+

+ Submission will send some basic data to Plugin Author as a servey. + Such: your site url, site title, this plugin version etc. You can Skip & Deactivate by click skip button. +

Keep diff --git a/admin/handle/plugin-deactive/message.css b/admin/handle/plugin-deactive/message.css index fe8ae53c..1bb86f7f 100644 --- a/admin/handle/plugin-deactive/message.css +++ b/admin/handle/plugin-deactive/message.css @@ -42,6 +42,7 @@ div.ca-survey-form p.motivational-speek { display: flex; gap: 10px; align-items: center; + justify-content: space-around; } .ca-survey-form .ca_button { margin: 0; @@ -70,10 +71,11 @@ div.ca-survey-form p.motivational-speek { float: left; } .ca-survey-form .ca_button#ca_skip { - background: #9e9e9e; + background: #9e9e9e52; border: none; color: #ffffff; font-weight: normal; + margin-left: auto; } .ca-survey-form .ca_button#ca_skip:hover { background: #2a2929; @@ -106,7 +108,7 @@ div.ca-survey-form p.motivational-speek { background-color: #0093b8; line-height: 1.14285714; } -.ca-email.common-target input { +.common-target input { width: 100%; margin-bottom: 10px; } diff --git a/admin/handle/pro-version-update.php b/admin/handle/pro-version-update.php index bc0dc7a2..b12cc402 100644 --- a/admin/handle/pro-version-update.php +++ b/admin/handle/pro-version-update.php @@ -12,7 +12,7 @@ * @author Saiful Islam */ class Pro_Version_Update{ - protected $request_min_pro = '8.1.7'; + protected $request_min_pro = '8.2.4'; public function run(){ if( ! defined( 'WPT_PRO_DEV_VERSION' ) ) return; diff --git a/admin/handle/tracker.php b/admin/handle/tracker.php new file mode 100644 index 00000000..9b09b67a --- /dev/null +++ b/admin/handle/tracker.php @@ -0,0 +1,367 @@ +plugin_prefix thakte hobe. + * noile kaj korobe na kintu. agei bole rakhlam. + * eta finalize korar date: 6 Aug, 2023 + * tobe eta agei kora hoyeche min max plugin a + * test korar jonno. + * emon ki chalu o kora hoiche. + * + * + * @author Saiful Islam + * + * + */ +class Tracker extends Base +{ + + protected $plugin_name = 'Woo Product Table'; + protected $plugin_version = WPT_DEV_VERSION; + protected $plugin_logo = WPT_ASSETS_URL . 'images/logo.png'; + /** + * If provided it will show on https://codeastrology.com/privacy-policy/$this->privacy_url + * + * @var null|string + */ + protected $privacy_url;// = 'plus-minus-plugin'; + + + /** + * Target menu + * It's can be sub menu or main/parent menu + * jodi amar target menu ekti sub menu hoye, tahole + * $this->if_parent a parent menu dite hobe + * + * R jobi nijei main menu hoy, tahole + * if_parent = null kore dite hobe. + * + * @var string + */ + public $target_menu = 'edit.php?post_type=wpt_product_table'; + public $if_parent;// = 'min-max-control';//woocommerce + + /** + * Very sectret, + * we need $this->plugin_fix to generate this + * key + * obbossoi Base class a $this->plugin_fix thakte hobe + * eta amra jenerete korbo constructor e + * @var string + */ + protected $transient_key; + protected $transient; + + /** + * Very sectret, + * we need $this->plugin_fix to generate this + * key + * obbossoi Base class a $this->plugin_fix thakte hobe + * eta amra jenerete korbo constructor e + * @var string + */ + public $option_key; + + protected $tracker_bool; + protected $option_allow; + + /** + * TRACK DELAY TIME: 3 HOURSE + * -------------------------- + * Transient Expireation time, + * which is the delay time of re-track + * After this time(3 hours), your site will send your status + * + * 1 hour = 3600 second + * half hour = 1800 second + * 3 hours = 10800 second + * 4 hours = 14400 second + * + * We have used 4 hours actually. + * + * @author Saiful Islam + */ + protected $transient_exp = 14400; // 14400 in second = 4 hours // when test used 60 + + public $_domain = 'http://edm.ultraaddons.com'; //Don't use slash at the end of the link. eg: http://wptheme.cm or: http://edm.ultraaddons.com + public $tracker_url; + + public $route = '/wp-json/tracker/v1/track'; + public $menu_url; + public $form_submit; + public function __construct() + { + + $this->option_key = $this->plugin_prefix . '_trak_optin'; + $this->form_submit = filter_input_array(INPUT_POST); + $this->option_allow = get_option( $this->option_key ); + $this->tracker_bool = $this->option_allow === 'allow' ? true : false; + // delete_option($this->option_key); //Debug Perpose Only + if( isset( $this->form_submit['allow_and_submit'] ) ){ + $allow = $this->form_submit['allow_and_submit'] ?? false; + update_option($this->option_key, $allow); + $this->option_allow = $allow; + $this->tracker_bool = $allow === 'allow' ? true : false; + } + + + //Base a obbossoi pri fix thakte hobe. + $this->transient_key = $this->plugin_prefix . '_transient_trak'; + $this->tracker_url = $this->_domain . $this->route; + $this->transient = get_transient( $this->transient_key ); + + $this->page_handle(); + + /** + * If any user want to approve manually + * then he/she can use manual_allow=yes + * to enable CodeAstrology tracker + * + * Otheriwse no need. + * @author Saiful Islam + * @since 4.6.0 + */ + if( isset($_GET['manual_allow']) && $_GET['manual_allow'] === 'yes' && $this->option_allow !== 'allow' ){ + update_option($this->option_key, 'allow'); + delete_transient($this->transient_key); + + } + } + public function page_handle() + { + if( $this->option_allow === 'allow' ){ + add_filter('admin_body_class', [$this, 'already_body_class']); + } + if($this->option_allow) return; + add_action('admin_notices', [$this, 'allow_notice']); + add_filter('admin_body_class', [$this, 'body_class']); + if($this->target_menu){ + $this->menu_url = admin_url( $this->target_menu ); + add_action('admin_head', [$this, 'render_html_css_js']); + + } + + } + public function hide_main_menu() { + // add_menu_page(); + // remove_submenu_page('parent-menu-slug', 'sub-menu-slug'); + } + public function run() + { + //Check Database permission, If not found permission, permisssion will not continue + if( ! $this->tracker_bool) return; + + /** + * If found, transient, track will not continue. + * Actually it will track only administrator is logedin even after every 30 minutes + */ + if( $this->transient ) return; + if( function_exists('current_user_can') && ! current_user_can('administrator') ) return; + + set_transient($this->transient_key, 'sent', $this->transient_exp); + $user = wp_get_current_user(); + + $theme = wp_get_theme(); + $themeName = $theme->Name; + + global $wpdb,$wp_version; + $other = []; + $other['plugin_version'] = $this->plugin_version; + $other['active_plugins'] = $this->active_plugins(); + + $other['php_version'] = PHP_VERSION; + + $other['wp_version'] = $wp_version; + $other['mysql_version'] = $wpdb->db_version(); + $other['wc_version'] = WC()->version; + $other['display_name'] = $user->display_name; + if( isset($_GET['manual_allow']) && $_GET['manual_allow'] === 'yes' && $this->option_allow !== 'allow' ){ + $other['manual_allow'] = 'yes'; + } + + $data = [ + 'plugin' => $this->plugin_name, + 'site' => site_url(), + 'site_title' => get_bloginfo('name'), + 'email' => $user->user_email, + 'theme' => $themeName, + 'other' => json_encode($other), + ]; + + $api_url = $this->tracker_url; // Replace this with your actual API endpoint + + // Send data to the tracking API using the WordPress HTTP API + wp_remote_post( $api_url, array( + 'method' => 'POST', + 'timeout' => 15, + 'headers' => array( + 'Content-Type' => 'application/json', + ), + 'body' => json_encode( $data ), + ) ); + } + + + /** + * Tracker Allow or skip form + * HTML markup + * + * return void + */ + public function page_html() + { + ?> +
+
+
+
+ +
+ plugin_logo){ + ?> + Logo <?php echo esc_attr( $this->plugin_name ); ?> + +

plugin_name ); ?>

+ + +
+
+

Never miss an important update

+
+
+

Opt in to get email notifications for security & feature updates, educational content, and occasional offers, and to share some basic WordPress environment info. This will help us make the plugin more compatible with your site and better at doing what you need it to.

+
+
+ + + + +
+
+ 😀 This will allow plugin_name ); ?> to ↓ +
+ +
+
+ +
+ +
+ id ) ? $current_screen->id : ''; + if( strpos( $s_id, $this->plugin_prefix) === false ) return; + $this->page_html(); + ?> + + + + id ) ? $current_screen->id : ''; + + if( strpos( $s_id, $this->plugin_prefix) === false ) return $classes; + $classes .= ' tracker-added allow-tracker-body '; + return $classes; + } + public function already_body_class($classes) + { + global $current_screen; + $s_id = isset( $current_screen->id ) ? $current_screen->id : ''; + + if( strpos( $s_id, $this->plugin_prefix) === false ) return $classes; + $classes .= ' already-added-tracker '; + return $classes; + } + + public function allow_notice() + { + $message = sprintf( + esc_html__( 'You are just one step away - %1$s', 'wcmmq' ), + '' . esc_html( $this->plugin_name ) . ' - Activate Now ' + ); + + printf( '

%1$s

', $message ); + } +} \ No newline at end of file diff --git a/admin/live_support_page.php b/admin/live_support_page.php index 2f2e5797..06fc68be 100644 --- a/admin/live_support_page.php +++ b/admin/live_support_page.php @@ -1,5 +1,5 @@ is_pro = defined( 'WPT_PRO_DEV_VERSION' ); + if($this->is_pro && class_exists( '\WOO_Product_Table' ) ){ + $this->pro_version = WPT_PRO_DEV_VERSION; + // $this->license = \WOO_Product_Table::$direct; + } + $this->page_folder_dir = $this->base_dir . 'admin/page/'; + $this->topbar_file = $this->page_folder_dir . 'topbar.php'; + $this->topbar_sub_title = __("Manage and Settings", "woo-product-table"); + } + + public function run() + { + + //has come from admin/menu_plugin_settings_link.php file + add_action( 'admin_menu', [$this, 'admin_menu'] ); + add_filter('admin_body_class', [$this, 'body_class']); + add_action( 'admin_enqueue_scripts', [$this, 'admin_enqueue_scripts'] ); + + } + + public function configure_page_render() + { + include $this->topbar_file; + if( ! $this->is_pro ){ + include $this->page_folder_dir . 'premium-link-header.php'; + } + include $this->page_folder_dir . 'configure.php'; + } + public function admin_menu() + { + add_submenu_page( $this->main_slug, esc_html__( 'Configuration', 'woo-product-table' ), esc_html__( 'Configure', 'woo-product-table' ), WPT_CAPABILITY, 'woo-product-table-config', [$this, 'configure_page_render'] ); + add_submenu_page( $this->main_slug, esc_html__( 'Tutorials', 'woo-product-table' ), __( 'Tutorial', 'woo-product-table' ), WPT_CAPABILITY, 'wpt-live-support', [$this, 'html_tutorial_page'] ); + + + add_submenu_page( $this->main_slug, esc_html__( 'Browse Plugins', 'woo-product-table' ), __( 'Browse Plugins', 'woo-product-table' ), WPT_CAPABILITY, 'wpt-browse-plugins',[$this, 'browse_plugins_html'] ); + add_submenu_page( $this->main_slug, esc_html__( 'Issue Submit', 'woo-product-table' ), __( 'Issue Submit', 'woo-product-table' ), WPT_CAPABILITY, 'https://github.com/codersaiful/woo-product-table/issues/new' ); + if( ! $this->is_pro ){ + add_submenu_page( $this->main_slug, esc_html__( 'Try Pro Version', 'woo-product-table' ), esc_html__( 'Try Pro Version', 'woo-product-table' ), WPT_CAPABILITY, 'https://try.wooproducttable.com/wp-admin/?utm=PluginDashboard' ); + add_submenu_page( $this->main_slug, esc_html__( 'GET PRO VERSION', 'woo-product-table' ), __( 'Get Pro', 'woo-product-table' ), WPT_CAPABILITY, 'https://wooproducttable.com/pricing/' ); + } + // var_dump($this->license); + + //License Menu if pro version is getter or equal V2.0.8.4 + // if( is_object( $this->license ) && version_compare($this->pro_version, '2.0.8.4', '>=')){ + // add_submenu_page( $this->main_slug, __('Min Max Control License', 'wcmmq_pro'), __( 'License', 'wcmmq_pro' ), $capability, 'wcmmq-license', [$this->license, 'license_page'] ); + // } + + } + + public function body_class( $classes ) + { + global $current_screen; + + + $s_id = isset( $current_screen->id ) ? $current_screen->id : ''; + + if( $s_id == 'edit-wpt_product_table' || $s_id == 'wpt_product_table' ){ + // $classes .= ' wp-default-content-wrapper '; + }else if( strpos( $s_id, $this->plugin_prefix ) !== false ){ + $classes .= ' wpt-zero-body '; + } + + + return $classes; + + } + public function admin_enqueue_scripts() + { + global $current_screen; + + $s_id = isset( $current_screen->id ) ? $current_screen->id : ''; + if( strpos( $s_id, $this->plugin_prefix ) === false ) return; + + add_filter('admin_footer_text',[$this, 'admin_footer_text']); + + + + + wp_register_style( $this->plugin_prefix . '-new-admin', $this->base_url . 'assets/css/new-admin.css', false, $this->dev_version ); + wp_enqueue_style( $this->plugin_prefix . '-new-admin' ); + } + + public function admin_footer_text($text) + { + $rev_link = 'https://wordpress.org/support/plugin/woo-product-table/reviews/#new-post'; + $text = sprintf( + __( 'Thank you for using Woo Product Table. %sPlease review us.' ), + $rev_link, + '' + ); + return '' . $text . ''; + } + public function browse_plugins_html() + { + //In future, I will make it like min max plugin - which I already did + // add_filter( 'plugins_api_result', [$this, 'plugins_api_result'], 1, 3 ); + $this->topbar_sub_title = __( 'Browse our Plugins','woo-product-table' ); + include $this->topbar_file; + if( ! $this->is_pro ){ + include $this->page_folder_dir . 'premium-link-header.php'; + } + include $this->page_folder_dir . 'browse-plugins.php'; + } + public function html_tutorial_page() + { + //In future, I will make it like min max plugin - which I already did + // add_filter( 'plugins_api_result', [$this, 'plugins_api_result'], 1, 3 ); + $this->topbar_sub_title = __( 'Tutorial','woo-product-table' ); + include $this->topbar_file; + if( ! $this->is_pro ){ + include $this->page_folder_dir . 'premium-link-header.php'; + } + include $this->page_folder_dir . 'tutorials.php'; + } +} \ No newline at end of file diff --git a/admin/page/browse-plugins.php b/admin/page/browse-plugins.php new file mode 100644 index 00000000..718d349b --- /dev/null +++ b/admin/page/browse-plugins.php @@ -0,0 +1,19 @@ +
+

+
+ +
+ prepare_items(); + + echo '
'; + $wp_list_table->display(); + echo '
'; + ?> +
+
+ +
\ No newline at end of file diff --git a/admin/page/configure.php b/admin/page/configure.php new file mode 100644 index 00000000..ddb47377 --- /dev/null +++ b/admin/page/configure.php @@ -0,0 +1,129 @@ + 'configuration_page', + 'module' => 'free', +); +$lang = apply_filters('wpml_current_language', NULL); +$default_lang = apply_filters('wpml_default_language', NULL); +$lang_ex = $lang == $default_lang ? '' : '_' . $lang; + +$default_lang_bool = $lang == $default_lang ? true : false; + +$root_option_key = WPT_OPTION_KEY; +$option_key = $root_option_key . $lang_ex; +$settings = apply_filters('wpto_configuration_settings', $settings); +if (isset($_POST['data']) && isset($_POST['reset_button'])) { + //Reset + $value = WPT_Product_Table::$default; + update_option($option_key, $value); +} else if (isset($_POST['data']) && isset($_POST['configure_submit'])) { + //configure_submit + $value = false; + if (is_array($_POST['data'])) { + $value = array_map( + function ($field) { + //All post value is santized here using array_map + return is_array($field) ? $field : sanitize_text_field($field); + }, + $_POST['data'] + ); + } + // $value 's all key_value is sanitized before update on database + update_option($option_key, $value); +} +$current_config_value = get_option($option_key); + +if (empty($current_config_value)) { + $current_config_value = get_option($root_option_key); +} + +$lang = apply_filters('wpml_current_language', NULL); +$default_lang = apply_filters('wpml_default_language', NULL); + + +$wrapper_class = isset($settings['module']) ? $settings['module'] : ''; + +?> +
+ +

+
+
+ +
+ +
+ + "> + + */ + do_action('wpto_admin_configuration_form_version_data', $settings, $current_config_value); + + if ($default_lang_bool) { + ?> + +
+ + + + + + + + + + +
+
+

+
+ +
+
+
+ + + +
+ + + + do_action('wpto_admin_configuration_form_bottom', $settings, $current_config_value); + ?> + +
+ + + + +
+ +
+
+ +
\ No newline at end of file diff --git a/admin/page/premium-link-header.php b/admin/page/premium-link-header.php new file mode 100644 index 00000000..c3ff5fb3 --- /dev/null +++ b/admin/page/premium-link-header.php @@ -0,0 +1,147 @@ +
+

+
+
+
+
+
+
+ + + +
+
+

Running Discount

+

Enjoy all awesome feature.

+
+ +
+
+
+ + Money Back Guarantee + +

100% No-Risk 30-Days Money Back Guarantee

+
+
+
+
+
+
+
+ + \ No newline at end of file diff --git a/admin/page/topbar.php b/admin/page/topbar.php new file mode 100644 index 00000000..4f43e3cc --- /dev/null +++ b/admin/page/topbar.php @@ -0,0 +1,78 @@ +license pabe na. + * tai notun kore check korechi. + */ +$license_direct = $pro = $license_page_slug = false; +if( class_exists( '\WOO_Product_Table' ) ){ + $pro = true; + $license_direct = property_exists( '\WOO_Product_Table','direct' ) ? \WOO_Product_Table::$direct : false; + $license_page_slug = defined('WPT_EDD_LICENSE_PAGE') ? WPT_EDD_LICENSE_PAGE : false; +} +$current_page = $_GET['page'] ?? ''; + +$topbar_sub_title = __( 'Manage and Settings', 'wpt' ); +if( isset( $this->topbar_sub_title ) && ! empty( $this->topbar_sub_title ) ){ + $topbar_sub_title = $this->topbar_sub_title; +} +?> +
+
+
+
+
+ +
+
+

+
+ +
+

+
+ +
+
+ +
+
\ No newline at end of file diff --git a/admin/page/tutorials.php b/admin/page/tutorials.php new file mode 100644 index 00000000..80596ec1 --- /dev/null +++ b/admin/page/tutorials.php @@ -0,0 +1,512 @@ + + +
+

+
+ +
+ + + + +
+
+
+
+ + + + + + + + + + +
+ +
+
+
+ +
+

Troubleshoots

+
+ + + View All + +
+
+
+ +
+
+
+ +
+

Help us to Inprove Plugin

+
+ +
+
+
+ +
+
+
+ + + + +
+
+ +
+ + diff --git a/admin/post_metabox.php b/admin/post_metabox.php index 49939020..987dfe68 100644 --- a/admin/post_metabox.php +++ b/admin/post_metabox.php @@ -99,26 +99,7 @@ function wpt_shortcode_metabox_render(){ All Pages

-
- -

- - - - - . - | - - - | - Contributor at WP.org - | - Contributor at Github - - -

- -
+
-
- - -
- -
- - - -