init( $plugin_info ); $this->hooks(); } /** * Init constants and other variables. * * = Set the Plugin Update URL * * @return void */ private function init( $plugin_info ) { $this->plugin_info = $plugin_info; $this->core_path = plugin_dir_path( __FILE__ ); $this->core_url = plugin_dir_url( __FILE__ ); $this->core_assets_path = $this->core_path . 'assets'; $this->core_assets_url = $this->core_url . 'assets'; $this->plugins_list = array( 'simple-countdown-timer' => array( 'title' => 'Simple Countdown Timer', 'desc' => 'Add countdown timers easily to your WordPress website', 'thumbnail' => 'simple-countdown-timer.gif', 'free_link' => 'https://wordpress.org/plugins/simple-countdown/', 'pro_link' => 'https://grandplugins.com/product/simple-countdown-timer/?utm_source=free&utm_medium=sidebar&utm_content=' . $this->plugin_info['name'], ), 'wp-watermark-pdf' => array( 'title' => 'WP Watermark PDF', 'desc' => 'Add text and image watermarks to your PDF files easily with our watermark PDFs plugin.', 'thumbnail' => 'wp-watermark-pdf.png', 'free_link' => 'https://wordpress.org/plugins/watermark-pdf/', 'pro_link' => 'https://grandplugins.com/product/wp-watermark-pdf/?utm_source=free&utm_medium=sidebar&utm_content=' . $this->plugin_info['name'], ), 'woo-cart-limiter' => array( 'title' => 'WooCommerce Cart Limiter', 'desc' => 'Control your website cart, limit cart totals, products count and quantity, limit products based on other products in cart, set minimum and maxmium quantity limits and more...', 'thumbnail' => 'woo-cart-limiter.png', 'free_link' => 'https://wordpress.org/plugins/cart-limiter/', 'pro_link' => 'https://grandplugins.com/product/woo-cart-limiter/?utm_source=free&utm_medium=sidebar&utm_content=' . $this->plugin_info['name'], ), 'image-sizes-controller' => array( 'title' => 'Image Sizes Controller', 'desc' => 'Control your website image sizes, create custom image sizes and disable generating unneeded sizes.', 'thumbnail' => 'image-sizes-controller.png', 'free_link' => 'https://wordpress.org/plugins/image-sizes-controller/', 'pro_link' => 'https://grandplugins.com/product/image-sizes-controller/?utm_source=free&utm_medium=sidebar&utm_content=' . $this->plugin_info['name'], ), 'woo-coming-soon' => array( 'title' => 'WooCommerce Coming Soon Products', 'desc' => 'Set your products to coming soon mode with countdown timer.', 'thumbnail' => 'woo-coming-soon.png', 'free_link' => 'https://wordpress.org/plugins/coming-soon-products-for-woocommerce/', 'pro_link' => 'https://grandplugins.com/product/woo-coming-soon-products/?utm_source=free&utm_medium=sidebar&utm_content=' . $this->plugin_info['name'], ), 'wp-watermark-images' => array( 'title' => 'WP Watermark Images', 'desc' => 'protect your images by watermarking them with text and image watermarks using the most advanced watermarking plugin', 'thumbnail' => 'wp-watermark-images.png', 'free_link' => 'https://wordpress.org/plugins/watermark-images-for-wp-and-woo-grandpluginswp/', 'pro_link' => 'https://grandplugins.com/product/wp-images-watermark/?utm_source=free&utm_medium=sidebar&utm_content=' . $this->plugin_info['name'], ), 'woo-quick-view' => array( 'title' => 'WooCommerce Quick View and Buy Now', 'desc' => 'Increase your website conversion rate, encourage your visitors to buy from your website using quick view and buy now buttons with direct checkout.', 'thumbnail' => 'woo-quick-view-and-buy-now.png', 'free_link' => 'https://wordpress.org/plugins/quick-view-and-buy-now-for-woocommerce/', 'pro_link' => 'https://grandplugins.com/product/quick-view-and-buy-now-for-woocommerce/?utm_source=free&utm_medium=sidebar&utm_content=' . $this->plugin_info['name'], ), 'wp-gif-editor' => array( 'title' => 'WP GIF Uploader', 'desc' => 'Upload GIF images without losing the GIF animation in the uploaded gif and all generated subsizes.', 'thumbnail' => 'wp-gif-editor.gif', 'free_link' => 'https://wordpress.org/plugins/gif-uploader-wp-grandplugins', 'pro_link' => 'https://grandplugins.com/product/wp-gif-editor/?utm_source=free&utm_medium=sidebar&utm_content=' . $this->plugin_info['name'], ), 'woo-maintenance-mode' => array( 'title' => 'Woo Maintenance Mode', 'desc' => '', 'thumbnail' => 'woo-maintenance-mode.png', 'free_link' => 'https://wordpress.org/plugins/ultimate-maintenance-mode-for-woocommerce/', 'pro_link' => 'https://grandplugins.com/product/woocommerce-maintenance-mode-pro/?utm_source=free&utm_medium=sidebar&utm_content=' . $this->plugin_info['name'], ), ); } /** * Core Actions Hook. * * @return void */ public function core_actions( $action_type ) { if ( 'activated' === $action_type ) { $this->plugin_activated(); } elseif ( 'deactivated' === $action_type ) { $this->plugin_deactivated(); } elseif ( 'uninstall' === $action_type ) { $this->plugin_uninstalled(); } } /** * Core Hooks. * * @return void */ public function hooks() { add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ), 1000, 1 ); add_filter( 'plugin_action_links_' . $this->plugin_info['basename'], array( $this, 'premium_link' ), 10, 1 ); } /** * Premium Link * * @param array $links * @return array */ public function premium_link( $links ) { if ( ! empty( $this->plugin_info['pro_link'] ) ) { $links[] = '' . esc_html__( 'Premium' ) . ''; } return $links; } /** * Core Admin Scripts. * * @param string $hook_prefix * * @return void */ public function admin_scripts( $hook_suffix ) { global $pagenow; if ( ! wp_style_is( 'gpls-core-plugins-general-admin-head-styles-' . $this->version ) ) { wp_enqueue_style( 'gpls-core-plugins-general-admin-head-styles-' . $this->version, $this->core_assets_file( 'admin-head', 'css', 'css' ), array(), 'all' ); } } /** * Get Core assets file * * @param string $asset_file Assets File Name * @param string $type Assets File Folder Type [ js / css /images / etc.. ] * @param string $suffix Assets File Type [ js / css / png /jpg / etc ... ] * @param string $prefix [ .min ] * @return string */ public function core_assets_file( $asset_file, $type, $suffix, $prefix = 'min' ) { return $this->core_assets_url . '/dist/' . $type . '/' . $asset_file . ( ! empty( $prefix ) ? ( '.' . $prefix ) : '' ) . '.' . $suffix; } /** * Get Core assets lib file * * @param string $asset_file Assets File Name * @param string $suffix Assets File Type [ js / css / png /jpg / etc ... ] * @param string $prefix [ .min ] * @return string */ public function core_assets_lib( $asset_file, $suffix, $prefix = 'min' ) { return $this->core_assets_url . '/libs/' . $asset_file . ( ! empty( $prefix ) ? ( '.' . $prefix ) : '' ) . '.' . $suffix; } /** * Plugin Activation Hub function * * @return void */ public function plugin_activated() { do_action( $this->plugin_info['name'] . '-core-activated', $this ); } /** * Plugin Deactivation Hub function * * @return void */ public function plugin_deactivated() { do_action( $this->plugin_info['name'] . '-core-deactivated', $this ); } /** * Uninstall the plugin hook. * * @return void */ public function plugin_uninstalled() { do_action( $this->plugin_info['name'] . '-core-uninstalled', $this ); } /** * Pro Button. * * @param string $pro_link * @param string $btn_title * @param string $additional_classes * @param string $additional_css * @return void */ public function pro_btn( $pro_link = '', $btn_title = 'Pro', $additional_classes = '', $additional_css = '', $return = false ) { if ( empty( $pro_link ) && empty( $this->plugin_info['pro_link'] ) ) { return; } $pro_link = empty( $pro_link ) ? $this->plugin_info['pro_link'] : $pro_link; if ( $return ) { ob_start(); } ?>

plugin_info['review_link'] ) ) { return; } $review_link = ! empty( $review_link ) ? $review_link : $this->plugin_info['review_link']; ?>