PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 2.0.4
Adminify – White Label, Admin Menu Editor, Login Customizer v2.0.4
4.3.1 4.3.0 4.2.26 4.2.25 4.2.24 4.2.23 4.2.22 4.2.21 4.2.20 4.2.19 4.2.18 4.2.17 4.2.16 4.2.15 4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 4.1.17 All 164 releases
adminify / Inc / Admin / Options / Module_Google_PagesSpeed.php

Module_Google_PagesSpeed.php in Adminify – White Label, Admin Menu Editor, Login Customizer 2.0.4, at Inc/Admin/Options/Module_Google_PagesSpeed.php

91 lines 3.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WPAdminify\Inc\Admin\Options;
4
5 use WPAdminify\Inc\Utils;
6 use WPAdminify\Inc\Admin\AdminSettingsModel;
7
8 if (!defined('ABSPATH')) {
9 die;
10 } // Cannot access directly.
11
12 if (!class_exists('Module_Google_PagesSpeed')) {
13 class Module_Google_PagesSpeed extends AdminSettingsModel
14 {
15 public function __construct()
16 {
17 $this->google_pagepseed_settings();
18 }
19
20
21 public function get_defaults()
22 {
23 return [
24 'google_pagepseed_user_roles' => [],
25 'google_pagepseed_api_key' => ''
26 ];
27 }
28
29
30 /**
31 * Media Elements Sortable
32 *
33 * @return void
34 */
35
36 public function google_pagepseed_api_key(&$fields)
37 {
38 $fields[] = array(
39 'type' => 'subheading',
40 'content' => Utils::adminfiy_help_urls(
41 __('Google Pagespeed Settings', WP_ADMINIFY_TD),
42 'https://wpadminify.com/kb/google-pagespeed-insights/',
43 'https://www.youtube.com/playlist?list=PLqpMw0NsHXV-EKj9Xm1DMGa6FGniHHly8',
44 'https://www.facebook.com/groups/jeweltheme',
45 'https://wpadminify.com/support/google-pagespeed-insights/'
46 )
47 );
48
49 $fields[] = array(
50 'id' => 'google_pagepseed_user_roles',
51 'type' => 'select',
52 'title' => 'Disable for',
53 'placeholder' => 'Select User roles you want to show',
54 'options' => 'roles',
55 'multiple' => true,
56 'chosen' => true,
57 'default' => $this->get_default_field('google_pagepseed_user_roles'),
58 );
59
60 $fields[] = array(
61 'id' => 'google_pagepseed_api_key',
62 'type' => 'textarea',
63 'title' => 'Google API Key',
64 'after' => sprintf(__('Don\'t have API key? Create one from <a href="%1$s" target="_blank">Google Console</a> to Unlock this feature. Read the full <a href="%2$s" target="_blank">Documentation</a>', WP_ADMINIFY_TD), esc_url('https://console.developers.google.com'), esc_url('https://wpadminify.com/kb/how-to-create-google-api-key')),
65 'default' => $this->get_default_field('google_pagepseed_api_key'),
66 );
67 }
68
69
70 public function google_pagepseed_settings()
71 {
72
73 if (!class_exists('ADMINIFY')) {
74 return;
75 }
76
77 $fields = [];
78 $this->google_pagepseed_api_key($fields);
79
80 // Google PageSpeed Order Section
81 \ADMINIFY::createSection($this->prefix, array(
82 'title' => __('Google PageSpeed', WP_ADMINIFY_TD),
83 'id' => 'module_google_pagespeed_section',
84 'parent' => 'module_settings',
85 'icon' => 'fas fa-tachometer-alt',
86 'fields' => $fields
87 ));
88 }
89 }
90 }
91