Conditions | 25 |
Paths | > 20000 |
Total Lines | 510 |
Code Lines | 359 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
286 | public function get_addons() { |
||
287 | global $current_user; |
||
288 | check_ajax_referer( 'mi-admin-nonce', 'nonce' ); |
||
289 | |||
290 | if ( ! current_user_can( 'monsterinsights_view_dashboard' ) ) { |
||
291 | return; |
||
292 | } |
||
293 | |||
294 | if ( isset( $_POST['network'] ) && intval( $_POST['network'] ) > 0 ) { |
||
295 | define( 'WP_NETWORK_ADMIN', true ); |
||
296 | } |
||
297 | |||
298 | $addons_data = monsterinsights_get_addons(); |
||
299 | $parsed_addons = array(); |
||
300 | $installed_plugins = get_plugins(); |
||
301 | |||
302 | if ( ! is_array( $addons_data ) ) { |
||
303 | $addons_data = array(); |
||
304 | } |
||
305 | |||
306 | foreach ( $addons_data as $addons_type => $addons ) { |
||
307 | foreach ( $addons as $addon ) { |
||
308 | $slug = 'monsterinsights-' . $addon->slug; |
||
309 | if ( 'monsterinsights-ecommerce' === $slug && 'm' === $slug[0] ) { |
||
310 | $addon = $this->get_addon( $installed_plugins, $addons_type, $addon, $slug ); |
||
311 | if ( empty( $addon->installed ) ) { |
||
312 | $slug = 'ga-ecommerce'; |
||
313 | $addon = $this->get_addon( $installed_plugins, $addons_type, $addon, $slug ); |
||
314 | } |
||
315 | } else { |
||
316 | $addon = $this->get_addon( $installed_plugins, $addons_type, $addon, $slug ); |
||
317 | } |
||
318 | $parsed_addons[ $addon->slug ] = $addon; |
||
319 | } |
||
320 | } |
||
321 | |||
322 | // Include data about the plugins needed by some addons ( WooCommerce, EDD, Google AMP, CookieBot, etc ). |
||
323 | // WooCommerce. |
||
324 | $parsed_addons['woocommerce'] = array( |
||
325 | 'active' => class_exists( 'WooCommerce' ), |
||
326 | ); |
||
327 | // Edd. |
||
328 | $parsed_addons['easy_digital_downloads'] = array( |
||
329 | 'active' => class_exists( 'Easy_Digital_Downloads' ), |
||
330 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugins/plugin-edd.png', |
||
331 | 'title' => 'Easy Digital Downloads', |
||
332 | 'excerpt' => __( 'The best WordPress eCommerce plugin for selling digital downloads. Start selling eBooks, software, music, digital art, and more within minutes. Accept payments, manage subscriptions, advanced access control, and more.', 'google-analytics-for-wordpress' ), |
||
333 | 'installed' => array_key_exists( 'easy-digital-downloads/easy-digital-downloads.php', $installed_plugins ) || array_key_exists( 'easy-digital-downloads-pro/easy-digital-downloads.php', $installed_plugins ), |
||
334 | 'basename' => array_key_exists( 'easy-digital-downloads-pro/easy-digital-downloads.php', $installed_plugins ) ? 'easy-digital-downloads-pro/easy-digital-downloads.php' : 'easy-digital-downloads/easy-digital-downloads.php', |
||
335 | 'slug' => 'easy-digital-downloads', |
||
336 | 'settings' => admin_url( 'edit.php?post_type=download' ), |
||
337 | ); |
||
338 | // Ajax activation works only if the key is the same with the slug. keeping the older one for backwards compatibility |
||
339 | $parsed_addons['easy-digital-downloads'] = $parsed_addons['easy_digital_downloads']; |
||
340 | // MemberPress. |
||
341 | $parsed_addons['memberpress'] = array( |
||
342 | 'active' => defined( 'MEPR_VERSION' ) && version_compare( MEPR_VERSION, '1.3.43', '>' ), |
||
343 | ); |
||
344 | // MemberMouse. |
||
345 | $parsed_addons['membermouse'] = array( |
||
346 | 'active' => class_exists( 'MemberMouse' ), |
||
347 | ); |
||
348 | // LifterLMS. |
||
349 | $parsed_addons['lifterlms'] = array( |
||
350 | 'active' => function_exists( 'LLMS' ) && version_compare( LLMS()->version, '3.32.0', '>=' ), |
||
351 | ); |
||
352 | // Restrict Content Pro. |
||
353 | $parsed_addons['rcp'] = array( |
||
354 | 'active' => class_exists( 'Restrict_Content_Pro' ) && version_compare( RCP_PLUGIN_VERSION, '3.5.4', '>=' ), |
||
355 | ); |
||
356 | // GiveWP. |
||
357 | $parsed_addons['givewp'] = array( |
||
358 | 'active' => function_exists( 'Give' ), |
||
359 | ); |
||
360 | |||
361 | // Charitable WP. |
||
362 | $parsed_addons['charitable'] = array( |
||
363 | 'active' => class_exists( 'Charitable' ), |
||
364 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugins/plugin-charitable.png', |
||
365 | 'title' => 'Charitable', |
||
366 | 'excerpt' => __('Top-rated WordPress donation and fundraising plugin. Over 10,000+ non-profit organizations and website owners use Charitable to create fundraising campaigns and raise more money online.', 'google-analytics-for-wordpress'), |
||
367 | 'installed' => array_key_exists('charitable/charitable.php', $installed_plugins), |
||
368 | 'basename' => 'charitable/charitable.php', |
||
369 | 'slug' => 'charitable', |
||
370 | 'settings' => admin_url('admin.php?page=charitable'), |
||
371 | ); |
||
372 | |||
373 | // WPCode |
||
374 | $parsed_addons['wpcode'] = array( |
||
375 | 'active' => function_exists( 'WPCode' ), |
||
376 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugins/plugin-wpcode.png', |
||
377 | 'title' => 'WPCode', |
||
378 | 'excerpt' => __('Future proof your WordPress customizations with the most popular code snippet management plugin for WordPress. Trusted by over 1,500,000+ websites for easily adding code to WordPress right from the admin area.', 'google-analytics-for-wordpress'), |
||
379 | 'installed' => array_key_exists('insert-headers-and-footers/ihaf.php', $installed_plugins), |
||
380 | 'basename' => 'insert-headers-and-footers/ihaf.php', |
||
381 | 'slug' => 'insert-headers-and-footers', |
||
382 | 'settings' => admin_url('admin.php?page=wpcode-settings'), |
||
383 | ); |
||
384 | |||
385 | // Duplicator |
||
386 | $parsed_addons['duplicator'] = array( |
||
387 | 'active' => defined( 'DUPLICATOR_VERSION' ), |
||
388 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugins/plugin-duplicator.png', |
||
389 | 'title' => 'Duplicator', |
||
390 | 'excerpt' => __('Leading WordPress backup & site migration plugin. Over 1,500,000+ smart website owners use Duplicator to make reliable and secure WordPress backups to protect their websites. It also makes website migration really easy.', 'google-analytics-for-wordpress'), |
||
391 | 'installed' => array_key_exists('duplicator/duplicator.php', $installed_plugins), |
||
392 | 'basename' => 'duplicator/duplicator.php', |
||
393 | 'slug' => 'duplicator', |
||
394 | 'settings' => admin_url('admin.php?page=duplicator-settings'), |
||
395 | ); |
||
396 | |||
397 | // WishList Member. |
||
398 | $parsed_addons['wishlist_member'] = array( |
||
399 | 'active' => function_exists( 'wishlistmember_instance' ), |
||
400 | ); |
||
401 | // GiveWP Analytics. |
||
402 | $parsed_addons['givewp_google_analytics'] = array( |
||
403 | 'active' => function_exists( 'Give_Google_Analytics' ), |
||
404 | ); |
||
405 | // Cookiebot. |
||
406 | $parsed_addons['cookiebot'] = array( |
||
407 | 'active' => function_exists( 'monsterinsights_is_cookiebot_active' ) && monsterinsights_is_cookiebot_active(), |
||
408 | ); |
||
409 | // Cookie Notice. |
||
410 | $parsed_addons['cookie_notice'] = array( |
||
411 | 'active' => class_exists( 'Cookie_Notice' ), |
||
412 | ); |
||
413 | // Complianz. |
||
414 | $parsed_addons['complianz'] = array( |
||
415 | 'active' => defined( 'cmplz_plugin' ) || defined( 'cmplz_premium' ), |
||
416 | ); |
||
417 | // Cookie Yes |
||
418 | $parsed_addons['cookie_yes'] = array( |
||
419 | 'active' => defined( 'CLI_SETTINGS_FIELD' ), |
||
420 | ); |
||
421 | // Google AMP. |
||
422 | $parsed_addons['google_amp'] = array( |
||
423 | 'active' => defined( 'AMP__FILE__' ), |
||
424 | ); |
||
425 | // Yoast SEO. |
||
426 | $parsed_addons['yoast_seo'] = array( |
||
427 | 'active' => defined( 'WPSEO_VERSION' ), |
||
428 | ); |
||
429 | // EasyAffiliate. |
||
430 | $parsed_addons['easy_affiliate'] = array( |
||
431 | 'active' => defined( 'ESAF_EDITION' ), |
||
432 | ); |
||
433 | |||
434 | // AffiliateWP |
||
435 | $parsed_addons['affiliate-wp'] = array( |
||
436 | 'active' => class_exists('AffiliateWP_Core_Requirements_Check'), |
||
437 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugins/plugin-affiliate-wp.png', |
||
438 | 'title' => 'AffiliateWP', |
||
439 | 'excerpt' => __('The #1 affiliate management plugin for WordPress. Easily create an affiliate program for your eCommerce store or membership site within minutes and start growing your sales with the power of referral marketing.', 'google-analytics-for-wordpress'), |
||
440 | 'installed' => array_key_exists('affiliate-wp/affiliate-wp.php', $installed_plugins), |
||
441 | 'basename' => 'affiliate-wp/affiliate-wp.php', |
||
442 | 'slug' => 'affiliate-wp', |
||
443 | 'settings' => admin_url('admin.php?page=affiliate-wp-settings'), |
||
444 | 'redirect' => 'https://affiliatewp.com', |
||
445 | ); |
||
446 | |||
447 | // WP Simple Pay |
||
448 | $parsed_addons['wpsimplepay'] = array( |
||
449 | 'active' => defined('SIMPLE_PAY_VERSION'), |
||
450 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugins/plugin-wp-simple-pay.png', |
||
451 | 'title' => 'WP Simple Pay', |
||
452 | 'excerpt' => __('The #1 Stripe payments plugin for WordPress. Start accepting one-time and recurring payments on your WordPress site without setting up a shopping cart. No code required.', 'google-analytics-for-wordpress'), |
||
453 | 'installed' => array_key_exists('stripe/stripe-checkout.php', $installed_plugins), |
||
454 | 'basename' => 'stripe/stripe-checkout.php', |
||
455 | 'slug' => 'stripe', |
||
456 | 'settings' => admin_url('edit.php?post_type=simple-pay&page=simpay_settings'), |
||
457 | ); |
||
458 | |||
459 | // Sugar Calendar |
||
460 | $parsed_addons['sugarcalendar'] = array( |
||
461 | 'active' => class_exists('Sugar_Calendar\\Requirements_Check'), |
||
462 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugins/plugin-sugar-calendar.png', |
||
463 | 'title' => 'Sugar Calendar', |
||
464 | 'excerpt' => __('A simple & powerful event calendar plugin for WordPress that comes with all the event management features including payments, scheduling, timezones, ticketing, recurring events, and more.', 'google-analytics-for-wordpress'), |
||
465 | 'installed' => array_key_exists('sugar-calendar-lite/sugar-calendar-lite.php', $installed_plugins), |
||
466 | 'basename' => 'sugar-calendar-lite/sugar-calendar-lite.php', |
||
467 | 'slug' => 'sugar-calendar-lite', |
||
468 | 'settings' => admin_url('admin.php?page=sugar-calendar'), |
||
469 | ); |
||
470 | |||
471 | // WPForms. |
||
472 | $parsed_addons['wpforms-lite'] = array( |
||
473 | 'active' => function_exists( 'wpforms' ), |
||
474 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugins/plugin-wpforms.png', |
||
475 | 'title' => 'WPForms', |
||
476 | 'excerpt' => __( 'The best drag & drop WordPress form builder. Easily create beautiful contact forms, surveys, payment forms, and more with our 1000+ form templates. Trusted by over 6 million websites as the best forms plugin.', 'google-analytics-for-wordpress' ), |
||
477 | 'installed' => array_key_exists( 'wpforms-lite/wpforms.php', $installed_plugins ) || array_key_exists( 'wpforms/wpforms.php', $installed_plugins ), |
||
478 | 'basename' => 'wpforms-lite/wpforms.php', |
||
479 | 'slug' => 'wpforms-lite', |
||
480 | 'settings' => admin_url( 'admin.php?page=wpforms-overview' ), |
||
481 | ); |
||
482 | |||
483 | // UserFeedback. |
||
484 | $parsed_addons['userfeedback-lite'] = array( |
||
485 | 'active' => function_exists( 'userfeedback' ), |
||
486 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugin-userfeedback.png', |
||
487 | 'title' => 'UserFeedback', |
||
488 | 'excerpt' => __( 'Ask visitors questions about how they use your website or what features can make you more money.', 'google-analytics-for-wordpress' ), |
||
489 | 'installed' => array_key_exists( 'userfeedback-lite/userfeedback.php', $installed_plugins ) || array_key_exists( 'userfeedback/userfeedback.php', $installed_plugins ), |
||
490 | 'basename' => 'userfeedback-lite/userfeedback.php', |
||
491 | 'slug' => 'userfeedback-lite', |
||
492 | 'settings' => admin_url( 'admin.php?page=userfeedback_settings' ), |
||
493 | ); |
||
494 | |||
495 | // AIOSEO. |
||
496 | $parsed_addons['aioseo'] = array( |
||
497 | 'active' => function_exists( 'aioseo' ), |
||
498 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugins/plugin-all-in-one-seo.png', |
||
499 | 'title' => 'AIOSEO', |
||
500 | 'excerpt' => __( 'The original WordPress SEO plugin and toolkit that improves your website’s search rankings. Comes with all the SEO features like Local SEO, WooCommerce SEO, sitemaps, SEO optimizer, schema, and more.', 'google-analytics-for-wordpress' ), |
||
501 | 'installed' => array_key_exists( 'all-in-one-seo-pack/all_in_one_seo_pack.php', $installed_plugins ) || array_key_exists( 'all-in-one-seo-pack-pro/all_in_one_seo_pack.php', $installed_plugins ), |
||
502 | 'basename' => ( monsterinsights_is_installed_aioseo_pro() ) ? 'all-in-one-seo-pack-pro/all_in_one_seo_pack.php' : 'all-in-one-seo-pack/all_in_one_seo_pack.php', |
||
503 | 'slug' => 'all-in-one-seo-pack', |
||
504 | 'settings' => admin_url( 'admin.php?page=aioseo' ), |
||
505 | ); |
||
506 | |||
507 | // FunnelKit Stripe Woo Payment Gateway. |
||
508 | $parsed_addons['funnelkit-stripe-woo-payment-gateway'] = array( |
||
509 | 'active' => class_exists( 'FKWCS_Gateway_Stripe' ), |
||
510 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugins/plugin-funnelkit-stripe-woo-payment-gateway.png', |
||
511 | 'title' => 'Stripe Payment Gateway for WooCommerce', |
||
512 | 'excerpt' => __( 'Stripe Payment Gateway for WooCommerce is an integrated solution that lets you accept payments on your online store for web and mobile.', 'google-analytics-for-wordpress' ), |
||
513 | 'installed' => array_key_exists( 'funnelkit-stripe-woo-payment-gateway/funnelkit-stripe-woo-payment-gateway.php', $installed_plugins ), |
||
514 | 'basename' => 'funnelkit-stripe-woo-payment-gateway/funnelkit-stripe-woo-payment-gateway.php', |
||
515 | 'slug' => 'funnelkit-stripe-woo-payment-gateway', |
||
516 | 'settings' => admin_url( 'admin.php?page=wc-settings&tab=fkwcs_api_settings' ), |
||
517 | ); |
||
518 | |||
519 | // Use the plugin dir name as the array key since AJAX activation in add-ons page won't work. |
||
520 | $parsed_addons['all-in-one-seo-pack'] = $parsed_addons['aioseo']; |
||
521 | |||
522 | // OptinMonster. |
||
523 | $parsed_addons['optinmonster'] = array( |
||
524 | 'active' => class_exists( 'OMAPI' ), |
||
525 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugins/plugin-om.png', |
||
526 | 'title' => 'OptinMonster', |
||
527 | 'excerpt' => __( 'Instantly get more subscribers, leads, and sales with the #1 conversion optimization toolkit. Create high converting popups, announcement bars, spin a wheel, and more with smart targeting and personalization.', 'google-analytics-for-wordpress' ), |
||
528 | 'installed' => array_key_exists( 'optinmonster/optin-monster-wp-api.php', $installed_plugins ), |
||
529 | 'basename' => 'optinmonster/optin-monster-wp-api.php', |
||
530 | 'slug' => 'optinmonster', |
||
531 | 'settings' => admin_url( 'admin.php?page=optin-monster-dashboard' ), |
||
532 | ); |
||
533 | // WP Mail Smtp. |
||
534 | $parsed_addons['wp-mail-smtp'] = array( |
||
535 | 'active' => function_exists( 'wp_mail_smtp' ), |
||
536 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugins/plugin-smtp.png', |
||
537 | 'title' => 'WP Mail SMTP', |
||
538 | 'excerpt' => __( 'Improve your WordPress email deliverability and make sure that your website emails reach user’s inbox with the #1 SMTP plugin for WordPress. Over 3 million websites use it to fix WordPress email issues.', 'google-analytics-for-wordpress' ), |
||
539 | 'installed' => array_key_exists( 'wp-mail-smtp/wp_mail_smtp.php', $installed_plugins ), |
||
540 | 'basename' => 'wp-mail-smtp/wp_mail_smtp.php', |
||
541 | 'slug' => 'wp-mail-smtp', |
||
542 | ); |
||
543 | // SeedProd. |
||
544 | $parsed_addons['coming-soon'] = array( |
||
545 | 'active' => defined( 'SEEDPROD_VERSION' ), |
||
546 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugins/plugin-seedprod.png', |
||
547 | 'title' => 'SeedProd', |
||
548 | 'excerpt' => __( 'The fastest drag & drop landing page builder for WordPress. Create custom landing pages without writing code, connect them with your CRM, collect subscribers, and grow your audience. Trusted by 1 million sites.', 'google-analytics-for-wordpress' ), |
||
549 | 'installed' => array_key_exists( 'coming-soon/coming-soon.php', $installed_plugins ), |
||
550 | 'basename' => 'coming-soon/coming-soon.php', |
||
551 | 'slug' => 'coming-soon', |
||
552 | 'settings' => admin_url( 'admin.php?page=seedprod_lite' ), |
||
553 | ); |
||
554 | // RafflePress |
||
555 | $parsed_addons['rafflepress'] = array( |
||
556 | 'active' => defined('RAFFLEPRESS_VERSION'), |
||
557 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugins/plugin-rafflepress.png', |
||
558 | 'title' => 'RafflePress', |
||
559 | 'excerpt' => __( 'Turn your website visitors into brand ambassadors! Easily grow your email list, website traffic, and social media followers with the most powerful giveaways & contests plugin for WordPress.', 'google-analytics-for-wordpress' ), |
||
560 | 'installed' => array_key_exists( 'rafflepress/rafflepress.php', $installed_plugins ), |
||
561 | 'basename' => 'rafflepress/rafflepress.php', |
||
562 | 'slug' => 'rafflepress', |
||
563 | 'settings' => admin_url( 'admin.php?page=rafflepress_lite' ), |
||
564 | ); |
||
565 | // TrustPulse |
||
566 | $parsed_addons['trustpulse'] = array( |
||
567 | 'active' => defined('TRUSTPULSE_PLUGIN_VERSION'), |
||
568 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugins/plugin-trustpulse.png', |
||
569 | 'title' => 'TrustPulse', |
||
570 | 'excerpt' => __( 'Boost your sales and conversions by up to 15% with real-time social proof notifications. TrustPulse helps you show live user activity and purchases to help convince other users to purchase.', 'google-analytics-for-wordpress' ), |
||
571 | 'installed' => array_key_exists( 'trustpulse-api/trustpulse.php', $installed_plugins ), |
||
572 | 'basename' => 'trustpulse-api/trustpulse.php', |
||
573 | 'slug' => 'trustpulse-api', |
||
574 | ); |
||
575 | |||
576 | $parsed_addons['trustpulse-api'] = $parsed_addons['trustpulse']; |
||
577 | |||
578 | // SearchWP |
||
579 | $parsed_addons['searchwp'] = array( |
||
580 | 'active' => defined('SEARCHWP_LIVE_SEARCH_VERSION'), |
||
581 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugins/plugin-searchwp.png', |
||
582 | 'title' => 'SearchWP', |
||
583 | 'excerpt' => __('The most advanced WordPress search plugin. Customize your WordPress search algorithm, reorder search results, track search metrics, and everything you need to leverage search to grow your business.', 'google-analytics-for-wordpress'), |
||
584 | 'installed' => array_key_exists('searchwp-live-ajax-search/searchwp-live-ajax-search.php', $installed_plugins), |
||
585 | 'basename' => 'searchwp-live-ajax-search/searchwp-live-ajax-search.php', |
||
586 | 'slug' => 'searchwp-live-ajax-search', |
||
587 | 'settings' => admin_url('admin.php?page=searchwp-live-search'), |
||
588 | ); |
||
589 | |||
590 | // Smash Balloon (Instagram) |
||
591 | $parsed_addons['instagram-feed'] = array( |
||
592 | 'active' => defined( 'SBIVER' ), |
||
593 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugins/plugin-sb-instagram.png', |
||
594 | 'title' => 'Smash Balloon Instagram Feeds', |
||
595 | 'excerpt' => __( 'Easily display Instagram content on your WordPress site without writing any code. Comes with multiple templates, ability to show content from multiple accounts, hashtags, and more. Trusted by 1 million websites.', 'google-analytics-for-wordpress' ), |
||
596 | 'installed' => array_key_exists( 'instagram-feed/instagram-feed.php', $installed_plugins ), |
||
597 | 'basename' => 'instagram-feed/instagram-feed.php', |
||
598 | 'slug' => 'instagram-feed', |
||
599 | 'settings' => admin_url( 'admin.php?page=sb-instagram-feed' ), |
||
600 | ); |
||
601 | |||
602 | $parsed_addons['smash-balloon-instagram'] = $parsed_addons['instagram-feed']; |
||
603 | |||
604 | // Smash Balloon (Facebook) |
||
605 | $parsed_addons['custom-facebook-feed'] = array( |
||
606 | 'active' => defined( 'CFFVER' ), |
||
607 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugins/plugin-sb-facebook.png', |
||
608 | 'title' => 'Smash Balloon Facebook Feeds', |
||
609 | 'excerpt' => __( 'Easily display Facebook content on your WordPress site without writing any code. Comes with multiple templates, ability to embed albums, group content, reviews, live videos, comments, and reactions.', 'google-analytics-for-wordpress' ), |
||
610 | 'installed' => array_key_exists( 'custom-facebook-feed/custom-facebook-feed.php', $installed_plugins ), |
||
611 | 'basename' => 'custom-facebook-feed/custom-facebook-feed.php', |
||
612 | 'slug' => 'custom-facebook-feed', |
||
613 | 'settings' => admin_url( 'admin.php?page=cff-feed-builder' ), |
||
614 | ); |
||
615 | |||
616 | $parsed_addons['smash-balloon-facebook'] = $parsed_addons['custom-facebook-feed']; |
||
617 | |||
618 | // Smash Balloon (YouTube) |
||
619 | $parsed_addons['smash-balloon-youtube'] = array( |
||
620 | 'active' => defined('SBYVER'), |
||
621 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugins/plugin-sb-youtube.png', |
||
622 | 'title' => 'Smash Balloon YouTube Feeds', |
||
623 | 'excerpt' => __('Easily display YouTube videos on your WordPress site without writing any code. Comes with multiple layouts, ability to embed live streams, video filtering, ability to combine multiple channel videos, and more.', 'google-analytics-for-wordpress'), |
||
624 | 'installed' => array_key_exists('feeds-for-youtube/youtube-feed.php', $installed_plugins), |
||
625 | 'basename' => 'feeds-for-youtube/youtube-feed.php', |
||
626 | 'slug' => 'feeds-for-youtube', |
||
627 | 'settings' => admin_url('admin.php?page=sby-feed-builder'), |
||
628 | ); |
||
629 | |||
630 | // In Year in Review we need the exact slug for the key in order to make the AJAX activation work. |
||
631 | $parsed_addons['feeds-for-youtube'] = $parsed_addons['smash-balloon-youtube']; |
||
632 | |||
633 | // Smash Balloon (Twitter) |
||
634 | $parsed_addons['smash-balloon-twitter'] = array( |
||
635 | 'active' => defined('CTF_VERSION'), |
||
636 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugins/plugin-sb-twitter.png', |
||
637 | 'title' => 'Smash Balloon Twitter Feeds', |
||
638 | 'excerpt' => __('Easily display Twitter content in WordPress without writing any code. Comes with multiple layouts, ability to combine multiple Twitter feeds, Twitter card support, tweet moderation, and more.', 'google-analytics-for-wordpress'), |
||
639 | 'installed' => array_key_exists('custom-twitter-feeds/custom-twitter-feed.php', $installed_plugins), |
||
640 | 'basename' => 'custom-twitter-feeds/custom-twitter-feed.php', |
||
641 | 'slug' => 'custom-twitter-feeds', |
||
642 | 'settings' => admin_url('admin.php?page=ctf-feed-builder'), |
||
643 | ); |
||
644 | |||
645 | // We need the key of the addon to be exactly the slug. We should deprecate `smash-balloon-twitter` next version. |
||
646 | $parsed_addons['custom-twitter-feeds'] = $parsed_addons['smash-balloon-twitter']; |
||
647 | |||
648 | // PushEngage |
||
649 | $parsed_addons['pushengage'] = array( |
||
650 | 'active' => defined('PUSHENGAGE_VERSION'), |
||
651 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugins/plugin-pushengage.png', |
||
652 | 'title' => 'PushEngage', |
||
653 | 'excerpt' => __('Connect with your visitors after they leave your website with the leading web push notification software. Over 10,000+ businesses worldwide use PushEngage to send 15 billion notifications each month.', 'google-analytics-for-wordpress'), |
||
654 | 'installed' => array_key_exists( 'pushengage/main.php', $installed_plugins ), |
||
655 | 'basename' => 'pushengage/main.php', |
||
656 | 'slug' => 'pushengage', |
||
657 | ); |
||
658 | |||
659 | // Uncanny Automator |
||
660 | $parsed_addons['uncanny-automator'] = array( |
||
661 | 'active' => function_exists('automator_get_recipe_id'), |
||
662 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugins/plugin-uncanny-automator.png', |
||
663 | 'title' => 'Uncanny Automator', |
||
664 | 'excerpt' => __('Automate everything with the #1 no-code Automation tool for WordPress.', 'google-analytics-for-wordpress'), |
||
665 | 'installed' => array_key_exists('uncanny-automator/uncanny-automator.php', $installed_plugins), |
||
666 | 'basename' => 'uncanny-automator/uncanny-automator.php', |
||
667 | 'slug' => 'uncanny-automator', |
||
668 | 'setup_complete' => class_exists( 'Uncanny_Automator\Api_Server' ) ? !! \Uncanny_Automator\Api_Server::is_automator_connected() : false, |
||
669 | 'wizard_url' => admin_url( 'edit.php?post_type=uo-recipe&page=uncanny-automator-setup-wizard' ), |
||
670 | 'recipe_url' => admin_url( 'post-new.php?post_type=uo-recipe' ), |
||
671 | ); |
||
672 | |||
673 | // Pretty Links |
||
674 | $parsed_addons['pretty-link'] = array( |
||
675 | 'active' => class_exists( 'PrliBaseController' ), |
||
676 | 'icon' => '', |
||
677 | 'title' => 'Pretty Links', |
||
678 | 'excerpt' => __( 'Pretty Links helps you shrink, beautify, track, manage and share any URL on or off of your WordPress website. Create links that look how you want using your own domain name!', 'google-analytics-for-wordpress' ), |
||
679 | 'installed' => array_key_exists( 'pretty-link/pretty-link.php', $installed_plugins ), |
||
680 | 'basename' => 'pretty-link/pretty-link.php', |
||
681 | 'slug' => 'pretty-link', |
||
682 | 'settings' => admin_url( 'edit.php?post_type=pretty-link' ), |
||
683 | ); |
||
684 | // SearchWP |
||
685 | $parsed_addons['searchwp-live-ajax-search'] = array( |
||
686 | 'active' => defined( 'SEARCHWP_LIVE_SEARCH_VERSION' ), |
||
687 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugin-searchwp.svg', |
||
688 | 'title' => 'SearchWP', |
||
689 | 'excerpt' => __( 'The most advanced WordPress search plugin. Customize your WordPress search algorithm, reorder search results, track search metrics, and everything you need to leverage search to grow your business.', 'google-analytics-for-wordpress' ), |
||
690 | 'installed' => array_key_exists( 'searchwp-live-ajax-search/searchwp-live-ajax-search.php', $installed_plugins ), |
||
691 | 'basename' => 'searchwp-live-ajax-search/searchwp-live-ajax-search.php', |
||
692 | 'slug' => 'searchwp-live-ajax-search', |
||
693 | 'settings' => admin_url( 'admin.php?page=searchwp-live-search' ), |
||
694 | ); |
||
695 | // Sugar Calendar Lite |
||
696 | $parsed_addons['sugar-calendar-lite'] = array( |
||
697 | 'active' => class_exists( 'Sugar_Calendar\\Requirements_Check' ), |
||
698 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugin-sugar-calendar.svg', |
||
699 | 'title' => 'Sugar Calendar', |
||
700 | 'excerpt' => __( 'A simple & powerful event calendar plugin for WordPress that comes with all the event management features including payments, scheduling, timezones, ticketing, recurring events, and more.', 'google-analytics-for-wordpress' ), |
||
701 | 'installed' => array_key_exists( 'sugar-calendar-lite/sugar-calendar-lite.php', $installed_plugins ), |
||
702 | 'basename' => 'sugar-calendar-lite/sugar-calendar-lite.php', |
||
703 | 'slug' => 'sugar-calendar-lite', |
||
704 | 'settings' => admin_url( 'admin.php?page=sugar-calendar' ), |
||
705 | ); |
||
706 | // Charitable |
||
707 | $parsed_addons['charitable'] = array( |
||
708 | 'active' => class_exists( 'Charitable' ), |
||
709 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugins/plugin-charitable.png', |
||
710 | 'title' => 'WP Charitable', |
||
711 | 'excerpt' => __( 'Top-rated WordPress donation and fundraising plugin. Over 10,000+ non-profit organizations and website owners use Charitable to create fundraising campaigns and raise more money online.', 'google-analytics-for-wordpress' ), |
||
712 | 'installed' => array_key_exists( 'charitable/charitable.php', $installed_plugins ), |
||
713 | 'basename' => 'charitable/charitable.php', |
||
714 | 'slug' => 'charitable', |
||
715 | 'settings' => admin_url( 'admin.php?page=charitable&install=true' ), |
||
716 | ); |
||
717 | // WPCode |
||
718 | $parsed_addons['insert-headers-and-footers'] = array( |
||
719 | 'active' => class_exists( 'WPCode' ), |
||
720 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugin-wpcode.svg', |
||
721 | 'title' => 'WPCode', |
||
722 | 'excerpt' => __( 'Future proof your WordPress customizations with the most popular code snippet management plugin for WordPress. Trusted by over 1,500,000+ websites for easily adding code to WordPress right from the admin area.', 'google-analytics-for-wordpress' ), |
||
723 | 'installed' => array_key_exists( 'insert-headers-and-footers/ihaf.php', $installed_plugins ), |
||
724 | 'basename' => 'insert-headers-and-footers/ihaf.php', |
||
725 | 'slug' => 'insert-headers-and-footers', |
||
726 | 'settings' => admin_url( 'admin.php?page=wpcode' ), |
||
727 | ); |
||
728 | // Duplicator |
||
729 | $parsed_addons['duplicator'] = array( |
||
730 | 'active' => class_exists( 'DuplicatorPhpVersionCheck' ), |
||
731 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugins/plugin-duplicator.png', |
||
732 | 'title' => 'Duplicator', |
||
733 | 'excerpt' => __( 'Leading WordPress backup & site migration plugin. Over 1,500,000+ smart website owners use Duplicator to make reliable and secure WordPress backups to protect their websites. It also makes website migration really easy.', 'google-analytics-for-wordpress' ), |
||
734 | 'installed' => array_key_exists( 'duplicator/duplicator.php', $installed_plugins ), |
||
735 | 'basename' => 'duplicator/duplicator.php', |
||
736 | 'slug' => 'duplicator', |
||
737 | 'settings' => admin_url( 'admin.php?page=duplicator' ), |
||
738 | ); |
||
739 | // WP Simple Pay |
||
740 | $parsed_addons['stripe'] = array( |
||
741 | 'active' => defined( 'SIMPLE_PAY_MAIN_FILE' ), |
||
742 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugin-simple-pay.svg', |
||
743 | 'title' => 'WP Simple Pay', |
||
744 | 'excerpt' => __( 'Start accepting one-time and recurring payments on your WordPress site without setting up a shopping cart. No code required.', 'google-analytics-for-wordpress' ), |
||
745 | 'installed' => array_key_exists( 'stripe/stripe-checkout.php', $installed_plugins ), |
||
746 | 'basename' => 'stripe/stripe-checkout.php', |
||
747 | 'slug' => 'stripe', |
||
748 | 'settings' => admin_url( 'edit.php?post_type=simple-pay&page=simpay_settings&tab=general' ), |
||
749 | ); |
||
750 | if ( function_exists( 'WC' ) ) { |
||
751 | // Advanced Coupons |
||
752 | $parsed_addons['advancedcoupons'] = array( |
||
753 | 'active' => class_exists( 'ACFWF' ), |
||
754 | 'icon' => '', |
||
755 | 'title' => 'Advanced Coupons', |
||
756 | 'excerpt' => __( 'Advanced Coupons for WooCommerce (Free Version) gives WooCommerce store owners extra coupon features so they can market their stores better.', 'google-analytics-for-wordpress' ), |
||
757 | 'installed' => array_key_exists( 'advanced-coupons-for-woocommerce-free/advanced-coupons-for-woocommerce-free.php', $installed_plugins ), |
||
758 | 'basename' => 'advanced-coupons-for-woocommerce-free/advanced-coupons-for-woocommerce-free.php', |
||
759 | 'slug' => 'advanced-coupons-for-woocommerce-free', |
||
760 | 'settings' => admin_url( 'edit.php?post_type=shop_coupon&acfw' ), |
||
761 | ); |
||
762 | } |
||
763 | |||
764 | // UserFeedback. |
||
765 | $parsed_addons['userfeedback-lite'] = array( |
||
766 | 'active' => function_exists( 'userfeedback' ), |
||
767 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugins/plugin-userfeedback.png', |
||
768 | 'title' => 'UserFeedback', |
||
769 | 'excerpt' => __( 'See what your analytics software isn’t telling you with powerful UserFeedback surveys.', 'google-analytics-for-wordpress' ), |
||
770 | 'installed' => array_key_exists( 'userfeedback-lite/userfeedback.php', $installed_plugins ) || array_key_exists( 'userfeedback/userfeedback.php', $installed_plugins ), |
||
771 | 'basename' => 'userfeedback-lite/userfeedback.php', |
||
772 | 'slug' => 'userfeedback-lite', |
||
773 | 'settings' => admin_url( 'admin.php?page=userfeedback_onboarding' ), |
||
774 | 'surveys' => admin_url( 'admin.php?page=userfeedback_surveys' ), |
||
775 | 'setup_complete' => (get_option('userfeedback_onboarding_complete', 0) == 1), |
||
776 | ); |
||
777 | |||
778 | // Gravity Forms. |
||
779 | $parsed_addons['gravity_forms'] = array( |
||
780 | 'active' => class_exists( 'GFCommon' ), |
||
781 | ); |
||
782 | // Formidable Forms. |
||
783 | $parsed_addons['formidable_forms'] = array( |
||
784 | 'active' => class_exists( 'FrmHooksController' ), |
||
785 | ); |
||
786 | // Manual UA Addon. |
||
787 | if ( ! isset( $parsed_addons['manual_ua'] ) ) { |
||
788 | $parsed_addons['manual_ua'] = array( |
||
789 | 'active' => class_exists( 'MonsterInsights_Manual_UA' ), |
||
790 | ); |
||
791 | } |
||
792 | |||
793 | $parsed_addons = apply_filters('monsterinsights_parsed_addons', $parsed_addons); |
||
794 | |||
795 | wp_send_json( $parsed_addons ); |
||
796 | } |
||
1625 |