PluginProbe
MOBILOOK — Mobile View & Mobile‑Friendly Test / trunk
MOBILOOK — Mobile View & Mobile‑Friendly Test vtrunk
2.1.3 2.1.2 trunk 1.2.8 2.0.1 2.0.3 2.1.0 2.1.1
mobilook / mobilook.php

mobilook.php in MOBILOOK — Mobile View & Mobile‑Friendly Test trunk, at mobilook.php

134 lines 6.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /*
4 * Plugin Name: MOBILOOK — Mobile View & Mobile‑Friendly Test
5 * Description: Instant mobile view of website (pages, posts, products) for responsive web design on phone (+ dualscreen). This plugin also offers helpful tools on each page, such as LinkedIn Post Inspector, and Google Mobile-Friendly Test Tool.
6 * Author: Pagup
7 * Version: 2.1.3
8 * Requires at least: 5.0
9 * Requires PHP: 7.4
10 * Tested up to: 7.0
11 * Author URI: https://pagup.com/
12 * Text Domain: mobilook
13 * Domain Path: /languages/
14 * License: GPLv2 or later
15 * License URI: http://www.gnu.org/licenses/gpl-2.0.html
16 */
17 if ( !defined( 'ABSPATH' ) ) {
18 exit;
19 }
20 if ( !function_exists( 'mobilook_load_textdomain' ) ) {
21 function mobilook_load_textdomain() {
22 load_plugin_textdomain( 'mobilook', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
23 }
24 }
25 add_action( 'plugins_loaded', 'mobilook_load_textdomain' );
26
27 if ( function_exists( 'mobilook_fs' ) ) {
28 mobilook_fs()->set_basename( false, __FILE__ );
29 } else {
30 if ( !function_exists( 'mobilook_fs' ) ) {
31 if ( !defined( 'MOBILOOK_PLUGIN_BASE' ) ) {
32 define( 'MOBILOOK_PLUGIN_BASE', plugin_basename( __FILE__ ) );
33 }
34 if ( !defined( 'MOBILOOK_PLUGIN_DIR' ) ) {
35 define( 'MOBILOOK_PLUGIN_DIR', plugins_url( '', __FILE__ ) );
36 }
37 if ( !defined( 'MOBILOOK_PLUGIN_MODE' ) ) {
38 define( 'MOBILOOK_PLUGIN_MODE', "production" );
39 }
40 require plugin_dir_path( __FILE__ ) . 'vendor/autoload.php';
41 /******************************************
42 Freemius Init
43 *******************************************/
44 function mobilook_fs() {
45 global $mobilook_fs;
46 if ( !isset( $mobilook_fs ) ) {
47 // Include Freemius SDK.
48 require_once dirname( __FILE__ ) . '/vendor/freemius/start.php';
49 $mobilook_fs = fs_dynamic_init( array(
50 'id' => '3641',
51 'slug' => 'mobilook',
52 'type' => 'plugin',
53 'public_key' => 'pk_5061a0f11623f388ce4c9687f669e',
54 'is_premium' => false,
55 'is_org_compliant' => true,
56 'premium_suffix' => 'for Woocommerce & Debugger',
57 'has_addons' => false,
58 'has_paid_plans' => true,
59 'trial' => array(
60 'days' => 7,
61 'is_require_payment' => true,
62 ),
63 'has_affiliation' => 'all',
64 'menu' => array(
65 'slug' => 'mobilook',
66 'first-path' => 'admin.php?page=mobilook',
67 'support' => false,
68 ),
69 'is_live' => true,
70 ) );
71 }
72 return $mobilook_fs;
73 }
74
75 // Init Freemius.
76 mobilook_fs();
77 // Signal that SDK was initiated.
78 do_action( 'mobilook_fs_loaded' );
79 function mobilook_fs_settings_url() {
80 return admin_url( 'admin.php?page=mobilook' );
81 }
82
83 mobilook_fs()->add_filter( 'connect_url', 'mobilook_fs_settings_url' );
84 mobilook_fs()->add_filter( 'after_skip_url', 'mobilook_fs_settings_url' );
85 mobilook_fs()->add_filter( 'after_connect_url', 'mobilook_fs_settings_url' );
86 mobilook_fs()->add_filter( 'after_pending_connect_url', 'mobilook_fs_settings_url' );
87 // freemius opt-in
88 function mobilook_fs_custom_connect_message(
89 $message,
90 $user_first_name,
91 $product_title,
92 $user_login,
93 $site_link,
94 $freemius_link
95 ) {
96 $break = "<br><br>";
97 $more_plugins = '<p><a target="_blank" href="https://wordpress.org/plugins/meta-tags-for-seo/">Meta Tags for SEO</a>, <a target="_blank" href="https://wordpress.org/plugins/automatic-internal-links-for-seo/">Auto internal links for SEO</a>, <a target="_blank" href="https://wordpress.org/plugins/mobilook/">Bulk auto image Alt Text</a>, <a target="_blank" href="https://wordpress.org/plugins/bulk-image-title-attribute/">Bulk auto image Title Tag</a>, <a target="_blank" href="https://wordpress.org/plugins/mobilook/">Mobile view</a>, <a target="_blank" href="https://wordpress.org/plugins/better-robots-txt/">Wordpress Better-Robots.txt</a>, <a target="_blank" href="https://wordpress.org/plugins/wp-google-street-view/">Wp Google Street View</a>, <a target="_blank" href="https://wordpress.org/plugins/vidseo/">VidSeo</a>, ...</p>';
98 return sprintf( esc_html__( 'Hey %1$s, %2$s Click on Allow & Continue to start optimizing your responsive design on all devices (including foldable screen phones) with MOBILOOK! Don’t waste your time checking your phone to see if your website looks properly. MOBILOOK is a time-saver and features many very helpful tools, like LinkedIn Post Inspector, and Google Mobile-Friendly Test Tool.', 'mobilook' ), $user_first_name, $break ) . $more_plugins;
99 }
100
101 mobilook_fs()->add_filter(
102 'connect_message',
103 'mobilook_fs_custom_connect_message',
104 10,
105 6
106 );
107 class Mobilook {
108 function __construct() {
109 register_deactivation_hook( __FILE__, array(&$this, 'deactivate') );
110 }
111
112 public function deactivate() {
113 if ( \Pagup\Mobilook\Core\Option::check( 'remove_settings' ) ) {
114 delete_option( 'mobilook' );
115 delete_option( 'mobilook_tour' );
116 }
117 }
118
119 }
120
121 $mobilook = new Mobilook();
122 /*-----------------------------------------
123 FRONTEND CONTROLLER
124 ------------------------------------------*/
125 require_once 'admin/controllers/FrontendController.php';
126 /*-----------------------------------------
127 Settings
128 ------------------------------------------*/
129 if ( is_admin() ) {
130 include_once \Pagup\Mobilook\Core\Plugin::path( 'admin/Settings.php' );
131 }
132 }
133 }
134