MetaSlider - Version 3.6.7

Version Description

  • 2017/Dec/15 =

  • FEATURE: Adds back in some instructions on how to display the slideshow

  • TWEAK: Add DocBlock checking with CI for PHP and JS files

  • FIX: Adds compatibility fixes for older WP versions.

Download this release

Release Info

Developer DavidAnderson
Plugin Icon 128x128 MetaSlider
Version 3.6.7
Comparing to
See all releases

Code changes from version 3.6.6 to 3.6.7

admin/Notices.php CHANGED
@@ -4,19 +4,28 @@ if (!defined('ABSPATH')) die('No direct access allowed');
4
5
if (!class_exists('Updraft_Notices_1_0')) require_once(METASLIDER_PATH.'admin/lib/Updraft_Notices.php');
6
7
class MetaSlider_Notices extends Updraft_Notices_1_0 {
8
9
/**
10
- * @var object $ads - all ads
11
*/
12
protected $ads;
13
14
/**
15
* @var object $notices_content
16
*/
17
protected $notices_content;
18
19
/**
20
* @var object $plugin
21
*/
22
protected $plugin;
@@ -24,6 +33,8 @@ class MetaSlider_Notices extends Updraft_Notices_1_0 {
24
25
/**
26
* Populates ad content and loads assets
27
*/
28
public function __construct($plugin) {
29
$this->ads = $this->is_metasliderpro_installed() ? $this->pro_notices() : $this->lite_notices();
@@ -60,6 +71,7 @@ class MetaSlider_Notices extends Updraft_Notices_1_0 {
60
/**
61
* Returns notices that free/lite users should see. dismiss_time should match the key
62
* hide_time is in weeks. Use a string to hide for 9999 weeks.
63
* @return array returns an array of notices
64
*/
65
protected function lite_notices() {
@@ -162,6 +174,7 @@ class MetaSlider_Notices extends Updraft_Notices_1_0 {
162
163
/**
164
* Premium user notices, if any.
165
* @return string
166
*/
167
protected function pro_notices() {
@@ -182,6 +195,7 @@ class MetaSlider_Notices extends Updraft_Notices_1_0 {
182
/**
183
* Seasonal Notices. Note that if dismissed, they will stay dismissed for 9999 weeks
184
* Each year the key and dismiss time should be updated
185
* @return string
186
*/
187
protected function seasonal_notices() {
@@ -256,6 +270,7 @@ class MetaSlider_Notices extends Updraft_Notices_1_0 {
256
257
/**
258
* These appear inside a mega ad.
259
* @return string
260
*/
261
protected function mega_notice_parts() {
@@ -268,18 +283,18 @@ class MetaSlider_Notices extends Updraft_Notices_1_0 {
268
'button_meta' => 'ml-slider',
269
),
270
// 'wpo_pro' => array(
271
- // 'title' => __('WP-Optimize Premium'),
272
- // 'text' => __('offers unparalleled choice and flexibility, allowing you to select one or a combination of over a dozen optimization options.', 'ml-slider'),
273
- // 'image' => '',
274
- // 'button_link' => 'https://getwpo.com?utm_source=metaslider-plugin-page&utm_medium=banner',
275
- // 'button_meta' => 'ml-slider',
276
// ),
277
// 'udp_pro' => array(
278
- // 'title' => __('UpdraftPlus Premium'),
279
- // 'text' => __('provides personal support, the ability to copy sites, more storage destinations, encrypted backups for security, multiple backup destinations, better reporting, no adverts and plenty more.', 'ml-slider'),
280
- // 'image' => '',
281
- // 'button_link' => 'https://updraftplus.com?utm_source=metaslider-plugin-page&utm_medium=banner',
282
- // 'button_meta' => 'ml-slider',
283
// ),
284
'udp' => array(
285
'title' => __('UpdraftPlus'),
@@ -315,6 +330,7 @@ class MetaSlider_Notices extends Updraft_Notices_1_0 {
315
/**
316
* Check to disable ads on the Pro version. The parent function returns
317
* false if installed, so this is reversed and shouldn't be used for the validity function
318
* @return bool
319
*/
320
protected function is_metasliderpro_installed() {
@@ -323,6 +339,7 @@ class MetaSlider_Notices extends Updraft_Notices_1_0 {
323
324
/**
325
* Check to see if UpdraftPlus is installed
326
* @return bool
327
*/
328
protected function is_updraftplus_installed() {
@@ -331,6 +348,7 @@ class MetaSlider_Notices extends Updraft_Notices_1_0 {
331
332
/**
333
* Check to see if UpdraftPlus is installed
334
* @return bool
335
*/
336
protected function is_keyy_installed() {
@@ -339,6 +357,7 @@ class MetaSlider_Notices extends Updraft_Notices_1_0 {
339
340
/**
341
* Check to see if UpdraftCentral is installed
342
* @return bool
343
*/
344
protected function is_updraftcentral_installed() {
@@ -347,8 +366,9 @@ class MetaSlider_Notices extends Updraft_Notices_1_0 {
347
348
/**
349
* Checks if the user agent isn't set as en_GB or en_US, and if the language file doesn't exist
350
- * @param string $plugin_base_dir
351
- * @param string $product_name
352
* @return bool
353
*/
354
protected function translation_needed($plugin_base_dir = null, $product_name = null) {
@@ -357,6 +377,7 @@ class MetaSlider_Notices extends Updraft_Notices_1_0 {
357
358
/**
359
* This method checks to see if the ad has been dismissed
360
* @param string $ad_identifier - identifier for the ad
361
* @return bool returns true when we dont want to show the ad
362
*/
@@ -366,6 +387,7 @@ class MetaSlider_Notices extends Updraft_Notices_1_0 {
366
367
/**
368
* Returns all active seasonal ads
369
* @return array
370
*/
371
protected function valid_seasonal_notices() {
@@ -389,6 +411,8 @@ class MetaSlider_Notices extends Updraft_Notices_1_0 {
389
/**
390
* The logic is handled elsewhere. This being true does not skip
391
* the seasonal notices. Overrides parent function
392
* @return array
393
*/
394
protected function skip_seasonal_notices($notice_data) {
@@ -397,6 +421,7 @@ class MetaSlider_Notices extends Updraft_Notices_1_0 {
397
398
/**
399
* Checks whether this is an ad page - hard-coded
400
* @return bool
401
*/
402
protected function is_page_with_ads() {
@@ -413,6 +438,7 @@ class MetaSlider_Notices extends Updraft_Notices_1_0 {
413
/**
414
* This method checks to see if the ad waiting period is over (2 weeks)
415
* If not, it will set a two week time
416
* @return bool returns true when we dont want to show the ad
417
*/
418
protected function ad_delay_has_finished() {
@@ -425,12 +451,9 @@ class MetaSlider_Notices extends Updraft_Notices_1_0 {
425
426
// Disable this for now so that after a dismiss, ads hide for 24 hours
427
// if (get_option("ms_ads_first_seen_on")) {
428
-
429
- // // They have seen ads before which means the delay is over
430
- // return true;
431
// }
432
-
433
-
434
$delay = get_option("ms_hide_all_ads_until");
435
436
// Only start the timer if they see a page that has ads
@@ -465,7 +488,7 @@ class MetaSlider_Notices extends Updraft_Notices_1_0 {
465
return false;
466
}
467
468
- /*
469
* Method to handle dashboard notices
470
*/
471
public function show_dashboard_notices() {
@@ -474,8 +497,8 @@ class MetaSlider_Notices extends Updraft_Notices_1_0 {
474
475
// Override the delay to show the thankyou notice on activation
476
// if (!empty($_GET['ms_activated'])) {
477
- // $lite_notices = $this->lite_notices();
478
- // $this->notices_content['thankyou'] = $lite_notices['thankyou'];
479
// }
480
echo $this->do_notice(false, 'dashboard', true);
481
}
@@ -483,9 +506,10 @@ class MetaSlider_Notices extends Updraft_Notices_1_0 {
483
484
/**
485
* Selects the template and returns or displays the notice
486
- * @param array $notice_information - variable names/values to pass through to the template
487
- * @param bool $return_instead_of_echo - whether to
488
- * @param string $position - where the notice is being displayed
489
* @return null|string - depending on the value of $return_instead_of_echo
490
*/
491
protected function render_specified_notice($notice_information, $return_instead_of_echo = false, $position = 'header') {
@@ -499,9 +523,10 @@ class MetaSlider_Notices extends Updraft_Notices_1_0 {
499
500
/**
501
* Displays or returns the template
502
- * @param string $path file name of the template
503
- * @param bool $return_instead_of_echo
504
- * @param array $args
505
* @return null|string
506
*/
507
public function include_template($path, $return_instead_of_echo = false, $args = array()) {
@@ -518,6 +543,7 @@ class MetaSlider_Notices extends Updraft_Notices_1_0 {
518
519
/**
520
* Builds a link based on the type of notice being requested
521
* @param string $link - the URL to link to
522
* @param string $type - which notice is being displayed
523
* @return string - the resulting HTML
@@ -542,6 +568,7 @@ class MetaSlider_Notices extends Updraft_Notices_1_0 {
542
543
/**
544
* Handles any notice related ajax calls
545
* @return string - (JSON) Sends a success response unless an error is encountered
546
*/
547
public function ajax_notice_handler() {
@@ -572,7 +599,9 @@ class MetaSlider_Notices extends Updraft_Notices_1_0 {
572
573
/**
574
* Returns the available ads that havent been dismissed by the user
575
- * @param string|array the location for the ad
576
* @return array the identifier for the ad
577
*/
578
public function active_ads($location = 'header', $bypass_delay = false) {
@@ -604,7 +633,8 @@ class MetaSlider_Notices extends Updraft_Notices_1_0 {
604
605
/**
606
* Returns all possible ads or the specified identifier
607
- * @param string $ad_identifier
608
* @return string|null the data of the ad
609
*/
610
public function get_ad($ad_identifier = null) {
@@ -614,7 +644,8 @@ class MetaSlider_Notices extends Updraft_Notices_1_0 {
614
615
/**
616
* Checks if the ad identifier exists in any of the ads above
617
- * @param string $ad_identifier
618
* @return bool the data of the ad
619
*/
620
public function ad_exists($ad_identifier) {
@@ -624,8 +655,9 @@ class MetaSlider_Notices extends Updraft_Notices_1_0 {
624
625
/**
626
* Updates the stored value for how long to hide the ads
627
- * @param string $ad_identifier
628
- * @param int|string time in weeks or a string to show
629
* @return bool|WP_Error whether the update was a success
630
*/
631
public function dismiss_ad($ad_identifier, $weeks) {
4
5
if (!class_exists('Updraft_Notices_1_0')) require_once(METASLIDER_PATH.'admin/lib/Updraft_Notices.php');
6
7
+ /**
8
+ * Meta Slider notices
9
+ */
10
class MetaSlider_Notices extends Updraft_Notices_1_0 {
11
12
/**
13
+ * All Ads
14
+ *
15
+ * @var object $ads
16
*/
17
protected $ads;
18
19
/**
20
+ * Notices content
21
+ *
22
* @var object $notices_content
23
*/
24
protected $notices_content;
25
26
/**
27
+ * Plugin details
28
+ *
29
* @var object $plugin
30
*/
31
protected $plugin;
33
34
/**
35
* Populates ad content and loads assets
36
+ *
37
+ * @param array $plugin Plugin details
38
*/
39
public function __construct($plugin) {
40
$this->ads = $this->is_metasliderpro_installed() ? $this->pro_notices() : $this->lite_notices();
71
/**
72
* Returns notices that free/lite users should see. dismiss_time should match the key
73
* hide_time is in weeks. Use a string to hide for 9999 weeks.
74
+ *
75
* @return array returns an array of notices
76
*/
77
protected function lite_notices() {
174
175
/**
176
* Premium user notices, if any.
177
+ *
178
* @return string
179
*/
180
protected function pro_notices() {
195
/**
196
* Seasonal Notices. Note that if dismissed, they will stay dismissed for 9999 weeks
197
* Each year the key and dismiss time should be updated
198
+ *
199
* @return string
200
*/
201
protected function seasonal_notices() {
270
271
/**
272
* These appear inside a mega ad.
273
+ *
274
* @return string
275
*/
276
protected function mega_notice_parts() {
283
'button_meta' => 'ml-slider',
284
),
285
// 'wpo_pro' => array(
286
+ // 'title' => __('WP-Optimize Premium'),
287
+ // 'text' => __('offers unparalleled choice and flexibility, allowing you to select one or a combination of over a dozen optimization options.', 'ml-slider'),
288
+ // 'image' => '',
289
+ // 'button_link' => 'https://getwpo.com?utm_source=metaslider-plugin-page&utm_medium=banner',
290
+ // 'button_meta' => 'ml-slider',
291
// ),
292
// 'udp_pro' => array(
293
+ // 'title' => __('UpdraftPlus Premium'),
294
+ // 'text' => __('provides personal support, the ability to copy sites, more storage destinations, encrypted backups for security, multiple backup destinations, better reporting, no adverts and plenty more.', 'ml-slider'),
295
+ // 'image' => '',
296
+ // 'button_link' => 'https://updraftplus.com?utm_source=metaslider-plugin-page&utm_medium=banner',
297
+ // 'button_meta' => 'ml-slider',
298
// ),
299
'udp' => array(
300
'title' => __('UpdraftPlus'),
330
/**
331
* Check to disable ads on the Pro version. The parent function returns
332
* false if installed, so this is reversed and shouldn't be used for the validity function
333
+ *
334
* @return bool
335
*/
336
protected function is_metasliderpro_installed() {
339
340
/**
341
* Check to see if UpdraftPlus is installed
342
+ *
343
* @return bool
344
*/
345
protected function is_updraftplus_installed() {
348
349
/**
350
* Check to see if UpdraftPlus is installed
351
+ *
352
* @return bool
353
*/
354
protected function is_keyy_installed() {
357
358
/**
359
* Check to see if UpdraftCentral is installed
360
+ *
361
* @return bool
362
*/
363
protected function is_updraftcentral_installed() {
366
367
/**
368
* Checks if the user agent isn't set as en_GB or en_US, and if the language file doesn't exist
369
+ *
370
+ * @param string $plugin_base_dir The plguin base directory
371
+ * @param string $product_name Product name
372
* @return bool
373
*/
374
protected function translation_needed($plugin_base_dir = null, $product_name = null) {
377
378
/**
379
* This method checks to see if the ad has been dismissed
380
+ *
381
* @param string $ad_identifier - identifier for the ad
382
* @return bool returns true when we dont want to show the ad
383
*/
387
388
/**
389
* Returns all active seasonal ads
390
+ *
391
* @return array
392
*/
393
protected function valid_seasonal_notices() {
411
/**
412
* The logic is handled elsewhere. This being true does not skip
413
* the seasonal notices. Overrides parent function
414
+ *
415
+ * @param array $notice_data Notice data
416
* @return array
417
*/
418
protected function skip_seasonal_notices($notice_data) {
421
422
/**
423
* Checks whether this is an ad page - hard-coded
424
+ *
425
* @return bool
426
*/
427
protected function is_page_with_ads() {
438
/**
439
* This method checks to see if the ad waiting period is over (2 weeks)
440
* If not, it will set a two week time
441
+ *
442
* @return bool returns true when we dont want to show the ad
443
*/
444
protected function ad_delay_has_finished() {
451
452
// Disable this for now so that after a dismiss, ads hide for 24 hours
453
// if (get_option("ms_ads_first_seen_on")) {
454
+ // They have seen ads before which means the delay is over
455
+ // return true;
456
// }
457
$delay = get_option("ms_hide_all_ads_until");
458
459
// Only start the timer if they see a page that has ads
488
return false;
489
}
490
491
+ /**
492
* Method to handle dashboard notices
493
*/
494
public function show_dashboard_notices() {
497
498
// Override the delay to show the thankyou notice on activation
499
// if (!empty($_GET['ms_activated'])) {
500
+ // $lite_notices = $this->lite_notices();
501
+ // $this->notices_content['thankyou'] = $lite_notices['thankyou'];
502
// }
503
echo $this->do_notice(false, 'dashboard', true);
504
}
506
507
/**
508
* Selects the template and returns or displays the notice
509
+ *
510
+ * @param array $notice_information - variable names/values to pass through to the template
511
+ * @param bool $return_instead_of_echo - whether to
512
+ * @param string $position - where the notice is being displayed
513
* @return null|string - depending on the value of $return_instead_of_echo
514
*/
515
protected function render_specified_notice($notice_information, $return_instead_of_echo = false, $position = 'header') {
523
524
/**
525
* Displays or returns the template
526
+ *
527
+ * @param string $path file name of the template
528
+ * @param bool $return_instead_of_echo Return the template instead of printing
529
+ * @param array $args template arguments
530
* @return null|string
531
*/
532
public function include_template($path, $return_instead_of_echo = false, $args = array()) {
543
544
/**
545
* Builds a link based on the type of notice being requested
546
+ *
547
* @param string $link - the URL to link to
548
* @param string $type - which notice is being displayed
549
* @return string - the resulting HTML
568
569
/**
570
* Handles any notice related ajax calls
571
+ *
572
* @return string - (JSON) Sends a success response unless an error is encountered
573
*/
574
public function ajax_notice_handler() {
599
600
/**
601
* Returns the available ads that havent been dismissed by the user
602
+ *
603
+ * @param string|array $location the location for the ad
604
+ * @param boolean $bypass_delay Bypass the ad delay
605
* @return array the identifier for the ad
606
*/
607
public function active_ads($location = 'header', $bypass_delay = false) {
633
634
/**
635
* Returns all possible ads or the specified identifier
636
+ *
637
+ * @param string $ad_identifier Ad Identifier
638
* @return string|null the data of the ad
639
*/
640
public function get_ad($ad_identifier = null) {
644
645
/**
646
* Checks if the ad identifier exists in any of the ads above
647
+ *
648
+ * @param string $ad_identifier Ad Identifier
649
* @return bool the data of the ad
650
*/
651
public function ad_exists($ad_identifier) {
655
656
/**
657
* Updates the stored value for how long to hide the ads
658
+ *
659
+ * @param string $ad_identifier Ad Identifier
660
+ * @param int|string $weeks time in weeks or a string to show
661
* @return bool|WP_Error whether the update was a success
662
*/
663
public function dismiss_ad($ad_identifier, $weeks) {
admin/Pages.php CHANGED
@@ -1,29 +1,35 @@
1
<?php
2
-
3
- /*
4
* Entry point for building the wordpress admin pages.
5
* Temporarily extends the MetaSlider Class until more refactoring can be done.
6
*/
7
-
8
Class MetaSlider_Admin_Pages extends MetaSliderPlugin {
9
10
/**
11
- * @property string $capability - The minimum capability to view the admin page
12
*/
13
private $capability;
14
15
/**
16
- * @property object $plugin - The MetaSlider plugin class
17
*/
18
private $plugin;
19
20
- /*
21
- * @property string $current_page - The current admin page
22
*/
23
private $current_page;
24
25
/**
26
* Sets up the notices, security and loads assets for the admin page
27
*/
28
public function __construct($plugin) {
29
$this->plugin = $plugin;
@@ -75,6 +81,8 @@ Class MetaSlider_Admin_Pages extends MetaSliderPlugin {
75
'restore_language' => __("Undo", "ml-slider"),
76
'restored_language' => __("Slide restored", "ml-slider"),
77
'deleted_language' => __("Slide deleted", "ml-slider"),
78
'click_to_undo_language' => __("Press to undo", "ml-slider"),
79
'ajaxurl' => admin_url('admin-ajax.php'),
80
'update_image' => __("Select replacement image", "ml-slider"),
@@ -124,8 +132,9 @@ Class MetaSlider_Admin_Pages extends MetaSliderPlugin {
124
125
/**
126
* Method to add pages
127
- * @param string $title - The title of the page
128
- * @param string $slug - The slug used for the page
129
* @param string $parent - Setting a parent will make this page a submenu item
130
*/
131
public function add_page($title, $slug = '', $parent = '') {
1
<?php
2
+ /**
3
* Entry point for building the wordpress admin pages.
4
* Temporarily extends the MetaSlider Class until more refactoring can be done.
5
*/
6
Class MetaSlider_Admin_Pages extends MetaSliderPlugin {
7
8
/**
9
+ * The minimum capability to view the admin page
10
+ *
11
+ * @var string $capability
12
*/
13
private $capability;
14
15
/**
16
+ * The MetaSlider plugin class
17
+ *
18
+ * @var object $plugin
19
*/
20
private $plugin;
21
22
+ /**
23
+ * The current admin page
24
+ *
25
+ * @var string $current_page
26
*/
27
private $current_page;
28
29
/**
30
* Sets up the notices, security and loads assets for the admin page
31
+ *
32
+ * @param array $plugin Plugin details
33
*/
34
public function __construct($plugin) {
35
$this->plugin = $plugin;
81
'restore_language' => __("Undo", "ml-slider"),
82
'restored_language' => __("Slide restored", "ml-slider"),
83
'deleted_language' => __("Slide deleted", "ml-slider"),
84
+ 'success_language' => __("Success", "ml-slider"),
85
+ 'copied_language' => __("Item was copied to your clipboard", "ml-slider"),
86
'click_to_undo_language' => __("Press to undo", "ml-slider"),
87
'ajaxurl' => admin_url('admin-ajax.php'),
88
'update_image' => __("Select replacement image", "ml-slider"),
132
133
/**
134
* Method to add pages
135
+ *
136
+ * @param string $title - The title of the page
137
+ * @param string $slug - The slug used for the page
138
* @param string $parent - Setting a parent will make this page a submenu item
139
*/
140
public function add_page($title, $slug = '', $parent = '') {
admin/Tour.php CHANGED
@@ -1,20 +1,23 @@
1
<?php
2
3
if (!defined('ABSPATH')) die('No direct access allowed');
4
-
5
- /*
6
* Class for guided tour
7
*/
8
-
9
Class MetaSlider_Tour {
10
11
/**
12
* The plugin object
13
*/
14
protected $plugin;
15
16
/**
17
* Sets up the notices, security and loads assets for the admin page
18
*/
19
public function __construct($plugin, $page) {
20
$this->plugin = $plugin;
@@ -100,6 +103,7 @@ Class MetaSlider_Tour {
100
101
/**
102
* Updates the stored value for which step the tour ended on
103
* @param object $request - the http $_REQUEST obj
104
* @return bool|WP_Error The Boolean should be true
105
*/
@@ -109,10 +113,10 @@ Class MetaSlider_Tour {
109
}
110
111
/**
112
- * Handles AJAX calls
113
- *
114
- * @return String - (JSON) Sends a success response unless an error is encountered
115
- */
116
public function handle_ajax() {
117
if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'metaslider_tour_nonce')) {
118
return wp_send_json_error(array(
1
<?php
2
3
if (!defined('ABSPATH')) die('No direct access allowed');
4
+ /**
5
* Class for guided tour
6
*/
7
Class MetaSlider_Tour {
8
9
/**
10
* The plugin object
11
+ *
12
+ * @var array
13
*/
14
protected $plugin;
15
16
/**
17
* Sets up the notices, security and loads assets for the admin page
18
+ *
19
+ * @param array $plugin Plugin details
20
+ * @param string $page Tour page
21
*/
22
public function __construct($plugin, $page) {
23
$this->plugin = $plugin;
103
104
/**
105
* Updates the stored value for which step the tour ended on
106
+ *
107
* @param object $request - the http $_REQUEST obj
108
* @return bool|WP_Error The Boolean should be true
109
*/
113
}
114
115
/**
116
+ * Handles AJAX calls
117
+ *
118
+ * @return String - (JSON) Sends a success response unless an error is encountered
119
+ */
120
public function handle_ajax() {
121
if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'metaslider_tour_nonce')) {
122
return wp_send_json_error(array(
admin/assets/css/admin.css CHANGED
@@ -799,6 +799,7 @@ textarea:-ms-input-placeholder {
799
margin: 0 auto;
800
}
801
.metaslider-ui .metaslider-inner {
802
border: 1px solid #ccc;
803
border-top: 0;
804
box-sizing: border-box;
@@ -818,16 +819,7 @@ textarea:-ms-input-placeholder {
818
font-weight: normal;
819
margin: 0 0.5rem 0 0;
820
}
821
- .metaslider-ui .slider-title .metaslider-shortcode {
822
- border: 0;
823
- white-space: nowrap;
824
- min-width: 250px;
825
- box-shadow: none;
826
- font-family: monospace;
827
- margin: 0;
828
- color: #de6826;
829
- cursor: pointer;
830
- }
831
.metaslider-ui .slider-title .add-slide {
832
padding-top: 1px !important;
833
position: absolute !important;
@@ -835,6 +827,46 @@ textarea:-ms-input-placeholder {
835
top: 12px;
836
}
837
838
/* Slide Listing */
839
.metaslider-ui .metaslider-slides-container * {
840
box-sizing: border-box;
@@ -977,6 +1009,14 @@ textarea:-ms-input-placeholder {
977
}
978
979
/* Navigation */
980
.metaslider-ui .nav-tab * {
981
box-sizing: border-box;
982
}
@@ -988,8 +1028,9 @@ textarea:-ms-input-placeholder {
988
padding: 0.5rem;
989
max-width: 100px;
990
text-overflow: ellipsis;
991
- overflow: hidden;
992
outline: 0;
993
}
994
995
.metaslider-ui .nav-tab:active,
@@ -1203,6 +1244,10 @@ textarea:-ms-input-placeholder {
1203
line-height: 1;
1204
}
1205
1206
.metaslider-ui .settings .disabled {
1207
color:#bbb;
1208
font-style: italic;
@@ -1212,6 +1257,12 @@ textarea:-ms-input-placeholder {
1212
border-color: #bbb;
1213
}
1214
1215
/* Grid and add-on page */
1216
.btn-cta-gradient {
1217
background-image: -webkit-linear-gradient(to left, #00b1d5, #bf2fcb), -webkit-linear-gradient(to left, #00b1d5, #bf2fcb)!important;
@@ -1352,7 +1403,7 @@ textarea:-ms-input-placeholder {
1352
.metaslider-ui .restore-slide-link:hover span {
1353
color: #de6826;
1354
}
1355
- .metaslider-ui .restore-slide-link svg {
1356
position: relative;
1357
top: 2px;
1358
left: -2px;
799
margin: 0 auto;
800
}
801
.metaslider-ui .metaslider-inner {
802
+ background: rgba(224, 224, 224, 0.25);
803
border: 1px solid #ccc;
804
border-top: 0;
805
box-sizing: border-box;
819
font-weight: normal;
820
margin: 0 0.5rem 0 0;
821
}
822
+
823
.metaslider-ui .slider-title .add-slide {
824
padding-top: 1px !important;
825
position: absolute !important;
827
top: 12px;
828
}
829
830
+ /* Shortcode Instructions */
831
+ .metaslider-ui .metaslider-shortcode {
832
+ padding: 7px 7px 7px 12px;
833
+ line-height: 15px;
834
+ margin: 0;
835
+ color: #cccccc;
836
+ }
837
+ .metaslider-ui .metaslider-shortcode .ms-shortcode::-moz-selection,
838
+ .metaslider-ui .metaslider-shortcode pre::-moz-selection {
839
+ color: #444;
840
+ background: #acd8fc;
841
+ }
842
+ .metaslider-ui .metaslider-shortcode .ms-shortcode::selection,
843
+ .metaslider-ui .metaslider-shortcode pre::selection {
844
+ color: #444;
845
+ background: #acd8fc;
846
+ }
847
+ .metaslider-ui .metaslider-shortcode p {
848
+ margin-top:0;
849
+ color: #444;
850
+ }
851
+ .metaslider-ui .metaslider-shortcode .ms-shortcode {
852
+ color: #de6826;
853
+ cursor: pointer;
854
+ }
855
+ .metaslider-ui .metaslider-shortcode .ml-button.ms-copy-all {
856
+ position: relative;
857
+ color: #0073aa;
858
+ padding: 0;
859
+ float: right;
860
+ }
861
+ .metaslider-ui .metaslider-shortcode .ml-button.ms-copy-all:hover {
862
+ color: #de6826;
863
+ }
864
+ .metaslider-ui .metaslider-shortcode .ml-button.ms-copy-all i {
865
+ position: relative;
866
+ top: 2px;
867
+ left: -2px;
868
+ }
869
+
870
/* Slide Listing */
871
.metaslider-ui .metaslider-slides-container * {
872
box-sizing: border-box;
1009
}
1010
1011
/* Navigation */
1012
+ .nav-tab-wrapper {
1013
+ border-bottom: 1px solid #ccc;
1014
+ margin: 0;
1015
+ padding-top: 9px;
1016
+ padding-bottom: 0;
1017
+ line-height: inherit;
1018
+ overflow: hidden;
1019
+ }
1020
.metaslider-ui .nav-tab * {
1021
box-sizing: border-box;
1022
}
1028
padding: 0.5rem;
1029
max-width: 100px;
1030
text-overflow: ellipsis;
1031
+ /* overflow: hidden; */
1032
outline: 0;
1033
+ float: left;
1034
}
1035
1036
.metaslider-ui .nav-tab:active,
1244
line-height: 1;
1245
}
1246
1247
+ input[type="radio"] {
1248
+ margin-right: 4px;
1249
+ }
1250
+
1251
.metaslider-ui .settings .disabled {
1252
color:#bbb;
1253
font-style: italic;
1257
border-color: #bbb;
1258
}
1259
1260
+ .wp-clearfix:after {
1261
+ content: "";
1262
+ display: table;
1263
+ clear: both;
1264
+ }
1265
+
1266
/* Grid and add-on page */
1267
.btn-cta-gradient {
1268
background-image: -webkit-linear-gradient(to left, #00b1d5, #bf2fcb), -webkit-linear-gradient(to left, #00b1d5, #bf2fcb)!important;
1403
.metaslider-ui .restore-slide-link:hover span {
1404
color: #de6826;
1405
}
1406
+ .metaslider-ui .restore-slide-link i {
1407
position: relative;
1408
top: 2px;
1409
left: -2px;
admin/assets/css/icon.css CHANGED
@@ -9,10 +9,20 @@
9
font-style: normal;
10
}
11
12
#adminmenu .toplevel_page_metaslider div.wp-menu-image:before,
13
#adminmenu .toplevel_page_metaslider-pro div.wp-menu-image:before {
14
content: "\e900" !important;
15
font-family: "metaslider" !important;
16
speak: none;
17
font-size: 28px;
18
}
9
font-style: normal;
10
}
11
12
+ #adminmenu .toplevel_page_metaslider div.wp-menu-image,
13
+ #adminmenu .toplevel_page_metaslider-pro div.wp-menu-image {
14
+ background: none;
15
+ width: 36px;
16
+ float: left;
17
+ text-align: center;
18
+ height: 100%;
19
+ }
20
#adminmenu .toplevel_page_metaslider div.wp-menu-image:before,
21
#adminmenu .toplevel_page_metaslider-pro div.wp-menu-image:before {
22
content: "\e900" !important;
23
font-family: "metaslider" !important;
24
speak: none;
25
font-size: 28px;
26
+ padding: 7px 0;
27
+ display: inline-block;
28
}
admin/assets/js/admin.js CHANGED
@@ -1,6 +1,63 @@
1
jQuery(function($) {
2
3
- /*
4
* UI for adding a slide. Managed through the WP media upload UI
5
* Event managed here.
6
*/
@@ -29,7 +86,7 @@ jQuery(function($) {
29
$.ajax({
30
url: metaslider.ajaxurl,
31
data: data,
32
- method: 'POST',
33
beforeSend: function() { MetaSlider_Helpers.loading(true); },
34
complete: function() {MetaSlider_Helpers.loading(false); },
35
error: function(response) {
@@ -37,10 +94,10 @@ jQuery(function($) {
37
},
38
success: function(response) {
39
40
- /*
41
- * Echo Slide on success
42
- * TODO: instead have it return data and use JS to render it
43
- */
44
$(".metaslider .left table").append(response);
45
MetaSlider_Helpers.loading(false)
46
$(".metaslider .left table").trigger('resizeSlides');
@@ -48,13 +105,13 @@ jQuery(function($) {
48
});
49
});
50
51
- /*
52
- * UI for changing slide image. Managed through the WP media upload UI
53
* Initialized dynamically due to multiple slides.
54
*/
55
var update_slide_frame;
56
57
- /*
58
* Opens the UI for the slide selection.
59
*/
60
$('.metaslider').on('click', '.add-slide', function(event){
@@ -72,8 +129,8 @@ jQuery(function($) {
72
$('.metaslider').on('click', '.update-image', function(event) {
73
event.preventDefault();
74
var $this = $(this);
75
-
76
- /*
77
* Opens up a media window showing images
78
*/
79
update_slide_frame = wp.media.frames.file_frame = wp.media({
@@ -84,7 +141,7 @@ jQuery(function($) {
84
}
85
}).open();
86
87
- /*
88
* Handles changing an image in DB and UI
89
*/
90
update_slide_frame.on('select', function() {
@@ -108,7 +165,7 @@ jQuery(function($) {
108
$.ajax({
109
url: metaslider.ajaxurl,
110
data: data,
111
- method: 'POST',
112
beforeSend: function() { MetaSlider_Helpers.loading(true); },
113
complete: function() {MetaSlider_Helpers.loading(false); },
114
error: function(response) {
@@ -116,7 +173,7 @@ jQuery(function($) {
116
},
117
success: function(response) {
118
119
- /*
120
* Updates the image on success
121
*/
122
$('#slide-' + $this.data('slideId') + ' .thumb')
@@ -153,7 +210,7 @@ jQuery(function($) {
153
$.ajax({
154
url: metaslider.ajaxurl,
155
data: data,
156
- method: 'POST',
157
error: function(response) {
158
159
// Delete failed. Remove delete state UI
@@ -233,7 +290,7 @@ jQuery(function($) {
233
$.ajax({
234
url: metaslider.ajaxurl,
235
data: data,
236
- method: 'POST',
237
error: function(response) {
238
239
// Undelete failed. Remove delete state UI
@@ -556,7 +613,6 @@ jQuery(function($) {
556
});
557
558
// UI/Feedback
559
-
560
// Events for the slideshow title
561
$('.metaslider .nav-tab-active input[name="title"]').on('focusin', function() {
562
@@ -594,6 +650,9 @@ var MetaSlider_Helpers = {
594
595
/**
596
* Various helper functions to use throughout
597
*/
598
capitalize: function(string) {
599
return string.replace(/\b\w/g, function(l){ return l.toUpperCase(); });
@@ -601,9 +660,10 @@ var MetaSlider_Helpers = {
601
602
/**
603
* Sets some basic loading state UI elements of the app. Currently,
604
- * it only enables or disables the input and shows a loading spinner.
605
- * @property {boolean} state
606
- */
607
loading: function(state) {
608
if (state) {
609
jQuery(".metaslider .spinner").show().css('visibility', 'visible');
@@ -656,7 +716,6 @@ var MS_Notification = function(message, submessage, image, _classname) {
656
}
657
658
// TODO add an option for svg
659
-
660
// If an extra class is set, set it
661
('undefined' !== typeof _classname) && this.notice.addClass(_classname);
662
@@ -677,8 +736,9 @@ MS_Notification.prototype.hide = function() {
677
678
/**
679
* Launch a notification and add a click event
680
- * @param int delay the time in milliseconds
681
- * @param string callback a method on the object or anon function
682
*/
683
MS_Notification.prototype.fire = function(delay, callback) {
684
var _this = this;
1
jQuery(function($) {
2
3
+ /**
4
+ * Allow the user to click on the element to select it.
5
+ *
6
+ * @param string elm Element The html element to be selected
7
+ */
8
+ var metaslider_select_text = function (elm) {
9
+ var range;
10
+ var selection;
11
+
12
+ // Most browsers will be able to select the text
13
+ if (window.getSelection) {
14
+ selection = window.getSelection();
15
+ range = document.createRange();
16
+ range.selectNodeContents(elm);
17
+ selection.removeAllRanges();
18
+ selection.addRange(range);
19
+ } else if (document.body.createTextRange) {
20
+ range = document.body.createTextRange();
21
+ range.moveToElementText(elm);
22
+ range.select();
23
+ }
24
+
25
+ // Some browsers will be able to copy the text too!
26
+ try {
27
+ if (document.execCommand('copy')) {
28
+ var notice = new MS_Notification(metaslider.success_language, metaslider.copied_language, undefined, 'is-success');
29
+ notice.fire(2000);
30
+ }
31
+ } catch (err) {
32
+ console.log('MetaSlider: Couldn\'t copy the text');
33
+ }
34
+ };
35
+
36
+ // Select the shortcode on click
37
+ $('.ms-shortcode').on('click', function () {
38
+ metaslider_select_text(this);
39
+ });
40
+
41
+ // Select the entire codeblock when the button is clicked
42
+ $('.ms-copy-all').on('click', function (event) {
43
+ event.preventDefault();
44
+ metaslider_select_text(document.getElementById('ms-entire-code'));
45
+ });
46
+
47
+ /**
48
+ * Filter out spaces when copying the shortcode.
49
+ */
50
+ document.getElementById('ms-entire-code')
51
+ .addEventListener('copy', function(event) {
52
+ var text = window.getSelection()
53
+ .toString().split("'").map(function(string, index) {
54
+ return (index === 1) ? string.replace(/\s/g, '').replace('ri', 'r i') : string;
55
+ }).join("'");
56
+ event.clipboardData.setData('text/plain', text);
57
+ event.preventDefault()
58
+ });
59
+
60
+ /**
61
* UI for adding a slide. Managed through the WP media upload UI
62
* Event managed here.
63
*/
86
$.ajax({
87
url: metaslider.ajaxurl,
88
data: data,
89
+ type: 'POST',
90
beforeSend: function() { MetaSlider_Helpers.loading(true); },
91
complete: function() {MetaSlider_Helpers.loading(false); },
92
error: function(response) {
94
},
95
success: function(response) {
96
97
+ /**
98
+ * Echo Slide on success
99
+ * TODO: instead have it return data and use JS to render it
100
+ */
101
$(".metaslider .left table").append(response);
102
MetaSlider_Helpers.loading(false)
103
$(".metaslider .left table").trigger('resizeSlides');
105
});
106
});
107
108
+ /**
109
+ * I for changing slide image. Managed through the WP media upload UI
110
* Initialized dynamically due to multiple slides.
111
*/
112
var update_slide_frame;
113
114
+ /**
115
* Opens the UI for the slide selection.
116
*/
117
$('.metaslider').on('click', '.add-slide', function(event){
129
$('.metaslider').on('click', '.update-image', function(event) {
130
event.preventDefault();
131
var $this = $(this);
132
+
133
+ /**
134
* Opens up a media window showing images
135
*/
136
update_slide_frame = wp.media.frames.file_frame = wp.media({
141
}
142
}).open();
143
144
+ /**
145
* Handles changing an image in DB and UI
146
*/
147
update_slide_frame.on('select', function() {
165
$.ajax({
166
url: metaslider.ajaxurl,
167
data: data,
168
+ type: 'POST',
169
beforeSend: function() { MetaSlider_Helpers.loading(true); },
170
complete: function() {MetaSlider_Helpers.loading(false); },
171
error: function(response) {
173
},
174
success: function(response) {
175
176
+ /**
177
* Updates the image on success
178
*/
179
$('#slide-' + $this.data('slideId') + ' .thumb')
210
$.ajax({
211
url: metaslider.ajaxurl,
212
data: data,
213
+ type: 'POST',
214
error: function(response) {
215
216
// Delete failed. Remove delete state UI
290
$.ajax({
291
url: metaslider.ajaxurl,
292
data: data,
293
+ type: 'POST',
294
error: function(response) {
295
296
// Undelete failed. Remove delete state UI
613
});
614
615
// UI/Feedback
616
// Events for the slideshow title
617
$('.metaslider .nav-tab-active input[name="title"]').on('focusin', function() {
618
650
651
/**
652
* Various helper functions to use throughout
653
+ *
654
+ * @param string string A string to capitalise
655
+ * @return string Returns capitalised string
656
*/
657
capitalize: function(string) {
658
return string.replace(/\b\w/g, function(l){ return l.toUpperCase(); });
660
661
/**
662
* Sets some basic loading state UI elements of the app. Currently,
663
+ * it only enables or disables the input and shows a loading spinner.#
664
+ *
665
+ * @param boolean state UI Elemetns
666
+ */
667
loading: function(state) {
668
if (state) {
669
jQuery(".metaslider .spinner").show().css('visibility', 'visible');
716
}
717
718
// TODO add an option for svg
719
// If an extra class is set, set it
720
('undefined' !== typeof _classname) && this.notice.addClass(_classname);
721
736
737
/**
738
* Launch a notification and add a click event
739
+ *
740
+ * @param int delay the time in milliseconds
741
+ * @param Function callback a method on the object or anon function
742
*/
743
MS_Notification.prototype.fire = function(delay, callback) {
744
var _this = this;
admin/assets/js/tour.js CHANGED
@@ -1,5 +1,8 @@
1
- // Not really a tour, but uses the same library to introduce the plugin.
2
- // This should always show when the user has no slideshows
3
var no_slideshows = new Shepherd.Tour({
4
defaults: {
5
classes: 'shepherd-theme-arrows shepherd-no-slideshows'
@@ -166,7 +169,7 @@ main_tour.on('cancel', function() {
166
jQuery.ajax({
167
url: metaslider.ajaxurl,
168
data: data,
169
- method: 'POST',
170
error: function(response) {
171
172
// Error to the console (useful if we get support feedback
1
+ /**
2
+ * Not really a tour, but uses the same library to introduce the plugin.
3
+ * This should always show when the user has no slideshows
4
+ */
5
+
6
var no_slideshows = new Shepherd.Tour({
7
defaults: {
8
classes: 'shepherd-theme-arrows shepherd-no-slideshows'
169
jQuery.ajax({
170
url: metaslider.ajaxurl,
171
data: data,
172
+ type: 'POST',
173
error: function(response) {
174
175
// Error to the console (useful if we get support feedback
admin/lib/Updraft_Notices.php CHANGED
@@ -100,7 +100,6 @@ abstract class Updraft_Notices_1_0 {
100
* @param Boolean $html_allowed a boolean value to indicate if HTML can be used or not
101
* @param String $url the url to use
102
* @param Boolean $https a boolean value to indicate if https should be used or not
103
- * @param String $website_home a string to be displayed
104
* @return String returns a string of the completed url
105
*/
106
protected function url_end($html_allowed, $url, $https = false) {
100
* @param Boolean $html_allowed a boolean value to indicate if HTML can be used or not
101
* @param String $url the url to use
102
* @param Boolean $https a boolean value to indicate if https should be used or not
103
* @return String returns a string of the completed url
104
*/
105
protected function url_end($html_allowed, $url, $https = false) {
admin/lib/helpers.php CHANGED
@@ -4,7 +4,8 @@ if (!defined('ABSPATH')) die('No direct access.');
4
5
/**
6
* Will be truthy if the plugin is installed
7
- * @param string name of the plugin 'ml-slider'
8
* @return bool|string - will return path, ex. 'ml-slider/ml-slider.php'
9
*/
10
function metaslider_is_plugin_installed($name) {
@@ -15,24 +16,25 @@ function metaslider_is_plugin_installed($name) {
15
return false;
16
}
17
/**
18
- * checks if metaslider pro is installed
19
- *
20
- * @return bool
21
- */
22
function metaslider_is_pro_installed() {
23
return (bool) metaslider_is_plugin_installed('ml-slider-pro');
24
}
25
26
/**
27
- * Will be true if the plugin is active
28
- *
29
- * @return bool
30
- */
31
function metaslider_is_pro_active() {
32
return is_plugin_active(metaslider_is_plugin_installed('ml-slider-pro'));
33
}
34
/**
35
* Returns true if the user does not have the pro version installed
36
* @return bool
37
*/
38
function metaslider_sees_upgrade_page() {
@@ -41,6 +43,7 @@ function metaslider_sees_upgrade_page() {
41
42
/**
43
* Returns true if the user does not have the pro version installed
44
* @return bool
45
*/
46
function metaslider_sees_call_to_action() {
@@ -48,11 +51,12 @@ function metaslider_sees_call_to_action() {
48
}
49
50
/**
51
- * Returns true if the user is ready to see notices. Exceptions include
52
- * when they have no slideshows (first start) and while on the initial tour.
53
- *
54
- * @return bool
55
- */
56
function metaslider_sees_notices($plugin) {
57
58
// If no slideshows, don't show an ad
@@ -66,20 +70,21 @@ function metaslider_sees_notices($plugin) {
66
}
67
68
/**
69
- * Returns true if the user is on the specified admin page
70
- *
71
- * @return bool
72
- */
73
function metaslider_is_on_admin_page($page_name = 'admin.php') {
74
global $pagenow;
75
return ($pagenow == $page_name);
76
}
77
78
/**
79
- * Returns the upgrade link
80
- *
81
- * @return string
82
- */
83
function metaslider_get_upgrade_link() {
84
return apply_filters('metaslider_hoplink', esc_url(
85
add_query_arg(array(
@@ -93,7 +98,8 @@ function metaslider_get_upgrade_link() {
93
94
/**
95
* Returns an array of the trashed slides
96
- * @param $slider
97
* @return array
98
*/
99
function metaslider_has_trashed_slides($slider_id) {
@@ -117,7 +123,8 @@ function metaslider_has_trashed_slides($slider_id) {
117
118
/**
119
* Returns whether we are looking at trashed slides
120
- * @param int $slider - the id
121
* @return bool
122
*/
123
function metaslider_viewing_trashed_slides($slider_id) {
@@ -133,6 +140,7 @@ function metaslider_viewing_trashed_slides($slider_id) {
133
134
/**
135
* Returns whether we are looking at a trashed slide
136
* @param object $slide a slide object
137
* @return bool
138
*/
4
5
/**
6
* Will be truthy if the plugin is installed
7
+ *
8
+ * @param string $name name of the plugin 'ml-slider'
9
* @return bool|string - will return path, ex. 'ml-slider/ml-slider.php'
10
*/
11
function metaslider_is_plugin_installed($name) {
16
return false;
17
}
18
/**
19
+ * checks if metaslider pro is installed
20
+ *
21
+ * @return bool
22
+ */
23
function metaslider_is_pro_installed() {
24
return (bool) metaslider_is_plugin_installed('ml-slider-pro');
25
}
26
27
/**
28
+ * Will be true if the plugin is active
29
+ *
30
+ * @return bool
31
+ */
32
function metaslider_is_pro_active() {
33
return is_plugin_active(metaslider_is_plugin_installed('ml-slider-pro'));
34
}
35
/**
36
* Returns true if the user does not have the pro version installed
37
+ *
38
* @return bool
39
*/
40
function metaslider_sees_upgrade_page() {
43
44
/**
45
* Returns true if the user does not have the pro version installed
46
+ *
47
* @return bool
48
*/
49
function metaslider_sees_call_to_action() {
51
}
52
53
/**
54
+ * Returns true if the user is ready to see notices. Exceptions include
55
+ * when they have no slideshows (first start) and while on the initial tour.
56
+ *
57
+ * @param array $plugin Plugin details
58
+ * @return boolean
59
+ */
60
function metaslider_sees_notices($plugin) {
61
62
// If no slideshows, don't show an ad
70
}
71
72
/**
73
+ * Returns true if the user is on the specified admin page
74
+ *
75
+ * @param string $page_name Admin page name
76
+ * @return boolean
77
+ */
78
function metaslider_is_on_admin_page($page_name = 'admin.php') {
79
global $pagenow;
80
return ($pagenow == $page_name);
81
}
82
83
/**
84
+ * Returns the upgrade link
85
+ *
86
+ * @return string
87
+ */
88
function metaslider_get_upgrade_link() {
89
return apply_filters('metaslider_hoplink', esc_url(
90
add_query_arg(array(
98
99
/**
100
* Returns an array of the trashed slides
101
+ *
102
+ * @param int $slider_id Slider ID
103
* @return array
104
*/
105
function metaslider_has_trashed_slides($slider_id) {
123
124
/**
125
* Returns whether we are looking at trashed slides
126
+ *
127
+ * @param int $slider_id - the id
128
* @return bool
129
*/
130
function metaslider_viewing_trashed_slides($slider_id) {
140
141
/**
142
* Returns whether we are looking at a trashed slide
143
+ *
144
* @param object $slide a slide object
145
* @return bool
146
*/
admin/views/pages/upgrade.php CHANGED
@@ -10,6 +10,7 @@ foreach ($our_plugins as $plugin) {
10
// If they have any plugins missing, make room for ads
11
$width = (in_array(false, $installed_plugins, true)) ? 'metaslider_half_width' : ''
12
?>
13
<div class="metaslider_col <?php echo $width; ?>">
14
<h2 class="ms-addon-headers">MetaSlider <?php _e("Comparison Chart", 'ml-slider');?></h2>
15
<table class="metaslider_feat_table">
@@ -166,4 +167,5 @@ $width = (in_array(false, $installed_plugins, true)) ? 'metaslider_half_width' :
166
</div>
167
</div>
168
<?php } ?>
169
</div>
10
// If they have any plugins missing, make room for ads
11
$width = (in_array(false, $installed_plugins, true)) ? 'metaslider_half_width' : ''
12
?>
13
+ <div>
14
<div class="metaslider_col <?php echo $width; ?>">
15
<h2 class="ms-addon-headers">MetaSlider <?php _e("Comparison Chart", 'ml-slider');?></h2>
16
<table class="metaslider_feat_table">
167
</div>
168
</div>
169
<?php } ?>
170
+ </div>
171
</div>
assets/metaslider/public.css CHANGED
@@ -122,7 +122,8 @@ body .metaslider .flexslider .flex-direction-nav li {
122
123
.flex-control-nav {
124
bottom: -30px;
125
- line-height: 11px;
126
}
127
128
/** move margin from list items to anchors */
@@ -204,6 +205,7 @@ body .metaslider .flexslider .flex-direction-nav li {
204
margin: -20px 0 0;
205
box-shadow: none!important;
206
display: block;
207
background-image: url('../sliders/flexslider/bg_direction_nav.png');
208
background-repeat: no-repeat;
209
position: absolute;
122
123
.flex-control-nav {
124
bottom: -30px;
125
+ line-height: 11px;
126
+ z-index: 2;
127
}
128
129
/** move margin from list items to anchors */
205
margin: -20px 0 0;
206
box-shadow: none!important;
207
display: block;
208
+ background-color: transparent;
209
background-image: url('../sliders/flexslider/bg_direction_nav.png');
210
background-repeat: no-repeat;
211
position: absolute;
inc/metaslider.imagehelper.class.php CHANGED
@@ -17,24 +17,28 @@ class MetaSliderImageHelper {
17
private $use_image_editor;
18
19
/**
20
- * @property integer $slide_id The ID of the image
21
- */
22
private $slide_id;
23
24
/**
25
- * @property integer $image_id The ID of the image
26
- */
27
public $image_id;
28
29
/**
30
* Constructor
31
*
32
- * @param integer $slide_id - The ID of the current slide
33
- * @param integer $width - Required width of image
34
- * @param integer $height - Required height of image
35
- * @param string $crop_type - The method used for cropping
36
* @param bool $use_image_editor - Whether to use the image editor
37
- * @param integer $image_id - used when the slide in admin is a looped item (i.e. post type)
38
*/
39
public function __construct($slide_id, $width, $height, $crop_type, $use_image_editor = true, $image_id = null) {
40
// There's a chance that $slide_id might be an $image_id
@@ -61,7 +65,7 @@ class MetaSliderImageHelper {
61
* Add in backwards compatibility for old versions of MS Pro
62
* 'true' = smart, 'false' = standard, 'disabled' = disabled
63
*
64
- * @param string $crop_type
65
*/
66
private function set_crop_type( $crop_type ) {
67
@@ -87,13 +91,12 @@ class MetaSliderImageHelper {
87
88
/**
89
* Return the crop dimensions.
90
- *
91
* Smart Crop: If the image is smaller than the container width or height, then return
92
* dimensions that respect the container size ratio. This ensures image displays in a
93
* sane manner in responsive sliders
94
*
95
- * @param integer $image_width
96
- * @param integer $image_height
97
* @return array image dimensions
98
*/
99
private function get_crop_dimensions( $image_width, $image_height ) {
@@ -140,7 +143,6 @@ class MetaSliderImageHelper {
140
if ( $image_width < $container_width && $image_height < $container_height ) {
141
if ( $container_width > $container_height ) {
142
// wide
143
-
144
if ( $image_width > $image_height ) {
145
// wide
146
$new_slide_height = $image_height;
@@ -214,7 +216,7 @@ class MetaSliderImageHelper {
214
/**
215
* Return the image URL, crop the image to the correct dimensions if required
216
*
217
- * @param bool $force_resize
218
* @return string resized image URL
219
*/
220
function get_image_url( $force_resize = false ) {
@@ -308,8 +310,9 @@ class MetaSliderImageHelper {
308
/**
309
* Use WP_Image_Editor to create a resized image and return the URL for that image
310
*
311
- * @param array $orig_size
312
- * @param array $dest_size
313
* @return string
314
*/
315
private function resize_image($orig_size, $dest_size, $dest_file_name) {
17
private $use_image_editor;
18
19
/**
20
+ * The ID of the image
21
+ *
22
+ * @var integer
23
+ */
24
private $slide_id;
25
26
/**
27
+ * The ID of the image
28
+ *
29
+ * @var integer
30
+ */
31
public $image_id;
32
33
/**
34
* Constructor
35
*
36
+ * @param integer $slide_id - The ID of the current slide
37
+ * @param integer $width - Required width of image
38
+ * @param integer $height - Required height of image
39
+ * @param string $crop_type - The method used for cropping
40
* @param bool $use_image_editor - Whether to use the image editor
41
+ * @param integer $image_id - used when the slide in admin is a looped item (i.e. post type)
42
*/
43
public function __construct($slide_id, $width, $height, $crop_type, $use_image_editor = true, $image_id = null) {
44
// There's a chance that $slide_id might be an $image_id
65
* Add in backwards compatibility for old versions of MS Pro
66
* 'true' = smart, 'false' = standard, 'disabled' = disabled
67
*
68
+ * @param string $crop_type Crop type
69
*/
70
private function set_crop_type( $crop_type ) {
71
91
92
/**
93
* Return the crop dimensions.
94
* Smart Crop: If the image is smaller than the container width or height, then return
95
* dimensions that respect the container size ratio. This ensures image displays in a
96
* sane manner in responsive sliders
97
*
98
+ * @param integer $image_width Image Width
99
+ * @param integer $image_height Image height
100
* @return array image dimensions
101
*/
102
private function get_crop_dimensions( $image_width, $image_height ) {
143
if ( $image_width < $container_width && $image_height < $container_height ) {
144
if ( $container_width > $container_height ) {
145
// wide
146
if ( $image_width > $image_height ) {
147
// wide
148
$new_slide_height = $image_height;
216
/**
217
* Return the image URL, crop the image to the correct dimensions if required
218
*
219
+ * @param bool $force_resize Force resize of image
220
* @return string resized image URL
221
*/
222
function get_image_url( $force_resize = false ) {
310
/**
311
* Use WP_Image_Editor to create a resized image and return the URL for that image
312
*
313
+ * @param array $orig_size Original image size
314
+ * @param array $dest_size Destination image size
315
+ * @param array $dest_file_name Destination file name
316
* @return string
317
*/
318
private function resize_image($orig_size, $dest_size, $dest_file_name) {
inc/metaslider.systemcheck.class.php CHANGED
@@ -26,7 +26,7 @@ class MetaSliderSystemCheck {
26
$this->checkWordPressVersion();
27
$this->checkImageLibrary();
28
$this->checkRoleScoper();
29
- //$this->checkWpFooter();
30
$this->updateSystemCheck();
31
}
32
@@ -148,6 +148,9 @@ class MetaSliderSystemCheck {
148
149
/**
150
* Print a warning message to the screen
151
*/
152
private function printMessage( $message, $key ) {
153
$nonce = wp_create_nonce( "metaslider-dismiss-{$key}" );
26
$this->checkWordPressVersion();
27
$this->checkImageLibrary();
28
$this->checkRoleScoper();
29
+ // $this->checkWpFooter();
30
$this->updateSystemCheck();
31
}
32
148
149
/**
150
* Print a warning message to the screen
151
+ *
152
+ * @param string $message Warning message to be shown
153
+ * @param string $key Message Key
154
*/
155
private function printMessage( $message, $key ) {
156
$nonce = wp_create_nonce( "metaslider-dismiss-{$key}" );
inc/metaslider.widget.class.php CHANGED
@@ -1,12 +1,11 @@
1
<?php
2
- /**
3
- * Adds MetaSlider widget.
4
- */
5
-
6
if ( ! defined( 'ABSPATH' ) ) {
7
exit; // disable direct access
8
}
9
10
class MetaSlider_Widget extends WP_Widget {
11
12
/**
@@ -25,8 +24,8 @@ class MetaSlider_Widget extends WP_Widget {
25
*
26
* @see WP_Widget::widget()
27
*
28
- * @param array $args Widget arguments.
29
- * @param array $instance Saved values from database.
30
*/
31
public function widget( $args, $instance ) {
32
extract( $args );
@@ -50,8 +49,8 @@ class MetaSlider_Widget extends WP_Widget {
50
*
51
* @see WP_Widget::update()
52
*
53
- * @param array $new_instance Values just sent to be saved.
54
- * @param array $old_instance Previously saved values from database.
55
*
56
* @return array Updated safe values to be saved.
57
*/
@@ -68,7 +67,7 @@ class MetaSlider_Widget extends WP_Widget {
68
*
69
* @see WP_Widget::form()
70
*
71
- * @param array $instance Previously saved values from database.
72
*/
73
public function form( $instance ) {
74
$selected_slider = 0;
1
<?php
2
if ( ! defined( 'ABSPATH' ) ) {
3
exit; // disable direct access
4
}
5
6
+ /**
7
+ * Adds MetaSlider widget.
8
+ */
9
class MetaSlider_Widget extends WP_Widget {
10
11
/**
24
*
25
* @see WP_Widget::widget()
26
*
27
+ * @param array $args Widget arguments.
28
+ * @param array $instance Saved values from database.
29
*/
30
public function widget( $args, $instance ) {
31
extract( $args );
49
*
50
* @see WP_Widget::update()
51
*
52
+ * @param array $new_instance Values just sent to be saved.
53
+ * @param array $old_instance Previously saved values from database.
54
*
55
* @return array Updated safe values to be saved.
56
*/
67
*
68
* @see WP_Widget::form()
69
*
70
+ * @param array $instance Previously saved values from database.
71
*/
72
public function form( $instance ) {
73
$selected_slider = 0;
inc/slide/metaslide.class.php CHANGED
@@ -26,14 +26,17 @@ class MetaSlide {
26
27
/**
28
* Set the slide
29
*/
30
public function set_slide( $id ) {
31
$this->slide = get_post( $id );
32
}
33
34
-
35
/**
36
* Set the slide (that this slide belongs to)
37
*/
38
public function set_slider( $id ) {
39
$this->slider = get_post( $id );
@@ -44,6 +47,8 @@ class MetaSlide {
44
/**
45
* Return the HTML for the slide
46
*
47
* @return array complete array of slides
48
*/
49
public function get_slide( $slide_id, $slider_id ) {
@@ -52,9 +57,12 @@ class MetaSlide {
52
return $this->get_slide_html();
53
}
54
55
-
56
/**
57
* Save the slide
58
*/
59
public function save_slide( $slide_id, $slider_id, $fields ) {
60
$this->set_slider( $slider_id );
@@ -72,7 +80,6 @@ class MetaSlide {
72
* @return array|WP_error The status message and if success, the thumbnail link
73
*/
74
protected function update_slide_image($slide_id, $image_id) {
75
-
76
/*
77
* Verifies that the $image_id is an actual image
78
*/
@@ -153,9 +160,12 @@ class MetaSlide {
153
154
}
155
156
-
157
/**
158
* Check if a slide already exists in a slideshow
159
*/
160
public function slide_exists_in_slideshow( $slider_id, $slide_id ) {
161
@@ -163,9 +173,12 @@ class MetaSlide {
163
164
}
165
166
-
167
/**
168
* Check if a slide has already been assigned to a slideshow
169
*/
170
public function slide_is_unassigned_or_image_slide( $slider_id, $slide_id ) {
171
@@ -179,7 +192,7 @@ class MetaSlide {
179
/**
180
* Build image HTML
181
*
182
- * @param array $attributes
183
* @return string image HTML
184
*/
185
public function build_image_tag( $attributes ) {
@@ -204,7 +217,8 @@ class MetaSlide {
204
/**
205
* Build image HTML
206
*
207
- * @param array $attributes
208
* @return string image HTML
209
*/
210
public function build_anchor_tag( $attributes, $content ) {
@@ -228,9 +242,9 @@ class MetaSlide {
228
* Create a new post for a slide. Tag a featured image to it.
229
*
230
* @since 3.4
231
- * @param string $media_id - Media File ID to use for the slide
232
- * @param string $type - the slide type identifier
233
- * @param int $slider_id - the parent slideshow ID
234
* @return int $slide_id - the ID of the newly created slide
235
*/
236
public function insert_slide($media_id, $type, $slider_id) {
@@ -326,6 +340,7 @@ class MetaSlide {
326
327
/**
328
* Generate the HTML for the delete button
329
* @return string
330
*/
331
public function get_delete_button_html() {
@@ -334,6 +349,7 @@ class MetaSlide {
334
335
/**
336
* Generate the HTML for the undelete button
337
* @return string
338
*/
339
public function get_undelete_button_html() {
@@ -342,6 +358,7 @@ class MetaSlide {
342
343
/**
344
* Generate the HTML for the perminant button
345
* @return string
346
*/
347
public function get_perminant_delete_button_html() {
@@ -353,6 +370,7 @@ class MetaSlide {
353
354
/**
355
* Generates the HTML for the update slide image button
356
* @return string The html for the edit button on a slide image
357
*/
358
public function get_update_image_button_html() {
@@ -439,6 +457,10 @@ class MetaSlide {
439
* If the meta doesn't exist, add it
440
* If the meta exists, but the value is empty, delete it
441
* If the meta exists, update it
442
*/
443
public function add_or_update_or_delete_meta( $post_id, $name, $value ) {
444
@@ -462,7 +484,8 @@ class MetaSlide {
462
/**
463
* Detect a [metaslider] or [ml-slider] shortcode in the slide caption, which has an ID that matches the current slideshow ID
464
*
465
- * @param $content string
466
*/
467
protected function detect_self_metaslider_shortcode( $content ) {
468
$pattern = get_shortcode_regex();
26
27
/**
28
* Set the slide
29
+ *
30
+ * @param int $id ID
31
*/
32
public function set_slide( $id ) {
33
$this->slide = get_post( $id );
34
}
35
36
/**
37
* Set the slide (that this slide belongs to)
38
+ *
39
+ * @param int $id ID
40
*/
41
public function set_slider( $id ) {
42
$this->slider = get_post( $id );
47
/**
48
* Return the HTML for the slide
49
*
50
+ * @param int $slide_id Slide ID
51
+ * @param int $slider_id Slider ID
52
* @return array complete array of slides
53
*/
54
public function get_slide( $slide_id, $slider_id ) {
57
return $this->get_slide_html();
58
}
59
60
/**
61
* Save the slide
62
+ *
63
+ * @param int $slide_id Slide ID
64
+ * @param int $slider_id Slider ID
65
+ * @param string $fields SLider fields
66
*/
67
public function save_slide( $slide_id, $slider_id, $fields ) {
68
$this->set_slider( $slider_id );
80
* @return array|WP_error The status message and if success, the thumbnail link
81
*/
82
protected function update_slide_image($slide_id, $image_id) {
83
/*
84
* Verifies that the $image_id is an actual image
85
*/
160
161
}
162
163
/**
164
* Check if a slide already exists in a slideshow
165
+ *
166
+ * @param string $slider_id Slider ID
167
+ * @param string $slide_id SLide ID
168
+ * @return string
169
*/
170
public function slide_exists_in_slideshow( $slider_id, $slide_id ) {
171
173
174
}
175
176
/**
177
* Check if a slide has already been assigned to a slideshow
178
+ *
179
+ * @param string $slider_id Slider ID
180
+ * @param string $slide_id SLide ID
181
+ * @return string
182
*/
183
public function slide_is_unassigned_or_image_slide( $slider_id, $slide_id ) {
184
192
/**
193
* Build image HTML
194
*
195
+ * @param array $attributes Anchor attributes
196
* @return string image HTML
197
*/
198
public function build_image_tag( $attributes ) {
217
/**
218
* Build image HTML
219
*
220
+ * @param array $attributes Anchor attributes
221
+ * @param string $content Anchor contents
222
* @return string image HTML
223
*/
224
public function build_anchor_tag( $attributes, $content ) {
242
* Create a new post for a slide. Tag a featured image to it.
243
*
244
* @since 3.4
245
+ * @param string $media_id - Media File ID to use for the slide
246
+ * @param string $type - the slide type identifier
247
+ * @param int $slider_id - the parent slideshow ID
248
* @return int $slide_id - the ID of the newly created slide
249
*/
250
public function insert_slide($media_id, $type, $slider_id) {
340
341
/**
342
* Generate the HTML for the delete button
343
+ *
344
* @return string
345
*/
346
public function get_delete_button_html() {
349
350
/**
351
* Generate the HTML for the undelete button
352
+ *
353
* @return string
354
*/
355
public function get_undelete_button_html() {
358
359
/**
360
* Generate the HTML for the perminant button
361
+ *
362
* @return string
363
*/
364
public function get_perminant_delete_button_html() {
370
371
/**
372
* Generates the HTML for the update slide image button
373
+ *
374
* @return string The html for the edit button on a slide image
375
*/
376
public function get_update_image_button_html() {
457
* If the meta doesn't exist, add it
458
* If the meta exists, but the value is empty, delete it
459
* If the meta exists, update it
460
+ *
461
+ * @param int $post_id Post ID
462
+ * @param string $name SLider Name
463
+ * @param int $value Slaider Value
464
*/
465
public function add_or_update_or_delete_meta( $post_id, $name, $value ) {
466
484
/**
485
* Detect a [metaslider] or [ml-slider] shortcode in the slide caption, which has an ID that matches the current slideshow ID
486
*
487
+ * @param string $content Content for shortcode
488
+ * @return boolean
489
*/
490
protected function detect_self_metaslider_shortcode( $content ) {
491
$pattern = get_shortcode_regex();
inc/slide/metaslide.image.class.php CHANGED
@@ -25,8 +25,8 @@ class MetaImageSlide extends MetaSlide {
25
* Currently this is used via an ajax call, but plans to keep this only called
26
* by PHP methods, such as in an import situation.
27
*
28
- * @param int $slider_id The id of the slider
29
- * @param array $data The data information for the new slide
30
*
31
* @return int | WP_error The status message and if success, the count
32
*/
@@ -59,8 +59,8 @@ class MetaImageSlide extends MetaSlide {
59
* Adds a single slide.
60
* TODO refactor and put this in a Slider class
61
*
62
- * @param int $slider_id The id of the slider
63
- * @param array $data The data information for the new slide
64
*
65
* @return string | WP_error The status message and if success, echo string for now
66
*/
@@ -108,7 +108,12 @@ class MetaImageSlide extends MetaSlide {
108
), 401);
109
}
110
111
- // TODO create a slide object class with data requirements and types
112
function make_image_slide_data($image_id) {
113
return array(
114
'type' => 'image',
@@ -122,13 +127,11 @@ class MetaImageSlide extends MetaSlide {
122
123
// TODO for now leave these out since it "echos" the slide...
124
// if (is_wp_error($result)) {
125
- // return wp_send_json_error(array(
126
- // 'messages' => $result->get_error_messages()
127
- // ), 409);
128
// }
129
-
130
// return wp_send_json_success($result, 200);
131
-
132
}
133
134
@@ -389,6 +392,7 @@ class MetaImageSlide extends MetaSlide {
389
/**
390
* Generate nivo slider markup
391
*
392
* @return string slide html
393
*/
394
private function get_nivo_slider_markup( $slide ) {
@@ -423,6 +427,7 @@ class MetaImageSlide extends MetaSlide {
423
/**
424
* Generate flex slider markup
425
*
426
* @return string slide html
427
*/
428
private function get_flex_slider_markup( $slide ) {
@@ -487,6 +492,10 @@ class MetaImageSlide extends MetaSlide {
487
/**
488
* Calculate the correct width (for vertical alignment) or top margin (for horizontal alignment)
489
* so that images are never stretched above the height set in the slideshow settings
490
*/
491
private function flex_smart_pad( $atts, $slide ) {
492
@@ -525,6 +534,7 @@ class MetaImageSlide extends MetaSlide {
525
/**
526
* Generate coin slider markup
527
*
528
* @return string slide html
529
*/
530
private function get_coin_slider_markup( $slide ) {
@@ -559,6 +569,7 @@ class MetaImageSlide extends MetaSlide {
559
/**
560
* Generate responsive slides markup
561
*
562
* @return string slide html
563
*/
564
private function get_responsive_slides_markup( $slide ) {
@@ -594,6 +605,8 @@ class MetaImageSlide extends MetaSlide {
594
595
/**
596
* Save
597
*/
598
protected function save( $fields ) {
599
25
* Currently this is used via an ajax call, but plans to keep this only called
26
* by PHP methods, such as in an import situation.
27
*
28
+ * @param int $slider_id The id of the slider
29
+ * @param array $data The data information for the new slide
30
*
31
* @return int | WP_error The status message and if success, the count
32
*/
59
* Adds a single slide.
60
* TODO refactor and put this in a Slider class
61
*
62
+ * @param int $slider_id The id of the slider
63
+ * @param array $data The data information for the new slide
64
*
65
* @return string | WP_error The status message and if success, echo string for now
66
*/
108
), 401);
109
}
110
111
+ /**
112
+ * TODO create a slide object class with data requirements and types
113
+ *
114
+ * @param int $image_id Image ID
115
+ * @return array
116
+ */
117
function make_image_slide_data($image_id) {
118
return array(
119
'type' => 'image',
127
128
// TODO for now leave these out since it "echos" the slide...
129
// if (is_wp_error($result)) {
130
+ // return wp_send_json_error(array(
131
+ // 'messages' => $result->get_error_messages()
132
+ // ), 409);
133
// }
134
// return wp_send_json_success($result, 200);
135
}
136
137
392
/**
393
* Generate nivo slider markup
394
*
395
+ * @param string $slide html
396
* @return string slide html
397
*/
398
private function get_nivo_slider_markup( $slide ) {
427
/**
428
* Generate flex slider markup
429
*
430
+ * @param string $slide html
431
* @return string slide html
432
*/
433
private function get_flex_slider_markup( $slide ) {
492
/**
493
* Calculate the correct width (for vertical alignment) or top margin (for horizontal alignment)
494
* so that images are never stretched above the height set in the slideshow settings
495
+ *
496
+ * @param array $atts Attributes
497
+ * @param array $slide Slide details
498
+ * @return string
499
*/
500
private function flex_smart_pad( $atts, $slide ) {
501
534
/**
535
* Generate coin slider markup
536
*
537
+ * @param string $slide html
538
* @return string slide html
539
*/
540
private function get_coin_slider_markup( $slide ) {
569
/**
570
* Generate responsive slides markup
571
*
572
+ * @param string $slide html
573
* @return string slide html
574
*/
575
private function get_responsive_slides_markup( $slide ) {
605
606
/**
607
* Save
608
+ *
609
+ * @param array $fields Fields to save
610
*/
611
protected function save( $fields ) {
612
inc/slider/metaslider.class.php CHANGED
@@ -14,11 +14,14 @@ class MetaSlider {
14
15
public $id = 0; // slider ID
16
public $identifier = 0; // unique identifier
17
- public $slides = array(); //slides belonging to this slider
18
public $settings = array(); // slider settings
19
20
/**
21
* Constructor
22
*/
23
public function __construct( $id, $shortcode_settings ) {
24
$this->id = $id;
@@ -56,7 +59,7 @@ class MetaSlider {
56
/**
57
* Return an individual setting
58
*
59
- * @param string $name Name of the setting
60
* @return string setting value or 'false'
61
*/
62
public function get_setting( $name ) {
@@ -128,6 +131,7 @@ class MetaSlider {
128
129
/**
130
* The main query for extracting the slides for the slideshow
131
* @return WP_Query
132
*/
133
public function get_slides() {
@@ -248,7 +252,7 @@ class MetaSlider {
248
*/
249
private function get_container_class() {
250
251
- //Add the version to the class name (if possible)
252
$version_string = str_replace('.', '-', urlencode(METASLIDER_VERSION));
253
$version_string .= defined('METASLIDERPRO_VERSION') ? ' ml-slider-pro-' . str_replace('.', '-', urlencode(METASLIDERPRO_VERSION)) : '';
254
$class = "ml-slider-{$version_string} metaslider metaslider-{$this->get_setting('type')} metaslider-{$this->id} ml-slider";
@@ -321,15 +325,6 @@ class MetaSlider {
321
$timer .= "\n };";
322
$timer .= "\n timer_" . $identifier . "();";
323
324
- /*$timer = "\n var timer_{$this->identifier} = function() {
325
- if ( typeof window.jQuery === 'undefined' ) {
326
- window.setTimeout(timer_metaslider_{$this->identifier}, 100);
327
- } else {
328
- window.jQuery(function() { {$this->identifier}(window.jQuery) });
329
- }
330
- };
331
- timer_{$this->identifier}();";*/
332
-
333
$init = apply_filters("metaslider_timer", $timer, $this->identifier);
334
335
return $script . $init;
@@ -446,16 +441,24 @@ class MetaSlider {
446
447
/**
448
* Polyfill to handle the wp_add_inline_script() function.
449
*/
450
public function wp_add_inline_script($handle, $data, $position = 'after') {
451
if (function_exists('wp_add_inline_script')) return wp_add_inline_script($handle, $data, $position);
452
global $wp_scripts;
453
if (!$data) return false;
454
- if ('after' !== $position) $position = 'before';
455
456
- $script = (array) $wp_scripts->get_data($handle, $position);
457
- $script[] = $data;
458
- return $wp_scripts->add_data($handle, $position, $script);
459
}
460
461
/**
14
15
public $id = 0; // slider ID
16
public $identifier = 0; // unique identifier
17
+ public $slides = array(); // slides belonging to this slider
18
public $settings = array(); // slider settings
19
20
/**
21
* Constructor
22
+ *
23
+ * @param int $id Slider ID
24
+ * @param array $shortcode_settings Short code settings
25
*/
26
public function __construct( $id, $shortcode_settings ) {
27
$this->id = $id;
59
/**
60
* Return an individual setting
61
*
62
+ * @param string $name Name of the setting
63
* @return string setting value or 'false'
64
*/
65
public function get_setting( $name ) {
131
132
/**
133
* The main query for extracting the slides for the slideshow
134
+ *
135
* @return WP_Query
136
*/
137
public function get_slides() {
252
*/
253
private function get_container_class() {
254
255
+ // Add the version to the class name (if possible)
256
$version_string = str_replace('.', '-', urlencode(METASLIDER_VERSION));
257
$version_string .= defined('METASLIDERPRO_VERSION') ? ' ml-slider-pro-' . str_replace('.', '-', urlencode(METASLIDERPRO_VERSION)) : '';
258
$class = "ml-slider-{$version_string} metaslider metaslider-{$this->get_setting('type')} metaslider-{$this->id} ml-slider";
325
$timer .= "\n };";
326
$timer .= "\n timer_" . $identifier . "();";
327
328
$init = apply_filters("metaslider_timer", $timer, $this->identifier);
329
330
return $script . $init;
441
442
/**
443
* Polyfill to handle the wp_add_inline_script() function.
444
+ *
445
+ * @param string $handle [description]
446
+ * @param array $data [description]
447
+ * @param string $position [description]
448
+ * @return array
449
*/
450
public function wp_add_inline_script($handle, $data, $position = 'after') {
451
if (function_exists('wp_add_inline_script')) return wp_add_inline_script($handle, $data, $position);
452
global $wp_scripts;
453
if (!$data) return false;
454
455
+ // First fetch any existing scripts
456
+ $script = $wp_scripts->get_data($handle, 'data');
457
+
458
+ // Append to the end
459
+ $script .= $data;
460
+
461
+ return $wp_scripts->add_data($handle, 'data', $script);
462
}
463
464
/**
inc/slider/metaslider.coin.class.php CHANGED
@@ -17,7 +17,8 @@ class MetaCoinSlider extends MetaSlider {
17
/**
18
* Enable the parameters that are accepted by the slider
19
*
20
- * @return array enabled parameters
21
*/
22
protected function get_param( $param ) {
23
$params = array(
17
/**
18
* Enable the parameters that are accepted by the slider
19
*
20
+ * @param array $param Parameters
21
+ * @return boolean
22
*/
23
protected function get_param( $param ) {
24
$params = array(
inc/slider/metaslider.flex.class.php CHANGED
@@ -18,6 +18,12 @@ class MetaFlexSlider extends MetaSlider {
18
*
19
* @param integer $id slideshow ID
20
*/
21
public function __construct( $id, $shortcode_settings ) {
22
parent::__construct( $id, $shortcode_settings );
23
@@ -30,8 +36,8 @@ class MetaFlexSlider extends MetaSlider {
30
/**
31
* Adjust the slider parameters so they're comparible with the carousel mode
32
*
33
- * @param array $options
34
- * @param integer $slider_id
35
* @return array $options
36
*/
37
public function enable_carousel_mode( $options, $slider_id ) {
@@ -56,8 +62,8 @@ class MetaFlexSlider extends MetaSlider {
56
/**
57
* Ensure CSS transitions are disabled when easing is enabled.
58
*
59
- * @param array $options
60
- * @param integer $slider_id
61
* @return array $options
62
*/
63
public function manage_easing( $options, $slider_id ) {
@@ -78,12 +84,12 @@ class MetaFlexSlider extends MetaSlider {
78
}
79
80
/**
81
- * Add a 'nav-hidden' class to slideshows where the navigation is hidden.
82
*
83
- * @param string $css
84
- * @param array $settings
85
- * @param integer $slider_id
86
- * @return string $css
87
*/
88
public function remove_bottom_margin( $class, $id, $settings ) {
89
if ( isset( $settings["navigation"] ) && $settings['navigation'] == 'false' ) {
@@ -99,9 +105,9 @@ class MetaFlexSlider extends MetaSlider {
99
/**
100
* Return css to ensure our slides are rendered correctly in the carousel
101
*
102
- * @param string $css
103
- * @param array $settings
104
- * @param integer $slider_id
105
* @return string $css
106
*/
107
public function get_carousel_css( $css, $settings, $slider_id ) {
@@ -119,7 +125,7 @@ class MetaFlexSlider extends MetaSlider {
119
/**
120
* Enable the parameters that are accepted by the slider
121
*
122
- * @param string $param
123
* @return array|boolean enabled parameters (false if parameter doesn't exist)
124
*/
125
protected function get_param( $param ) {
18
*
19
* @param integer $id slideshow ID
20
*/
21
+ /**
22
+ * Constructor
23
+ *
24
+ * @param int $id ID
25
+ * @param array $shortcode_settings Short code settings
26
+ */
27
public function __construct( $id, $shortcode_settings ) {
28
parent::__construct( $id, $shortcode_settings );
29
36
/**
37
* Adjust the slider parameters so they're comparible with the carousel mode
38
*
39
+ * @param array $options Slider options
40
+ * @param integer $slider_id Slider ID
41
* @return array $options
42
*/
43
public function enable_carousel_mode( $options, $slider_id ) {
62
/**
63
* Ensure CSS transitions are disabled when easing is enabled.
64
*
65
+ * @param array $options Slider options
66
+ * @param integer $slider_id Slider ID
67
* @return array $options
68
*/
69
public function manage_easing( $options, $slider_id ) {
84
}
85
86
/**
87
+ * Add a 'nav-hidden' class to slideshows where the navigation is hidde
88
*
89
+ * @param string $class Slider class
90
+ * @param int $id Slider ID
91
+ * @param array $settings Slider Settings
92
+ * @return string
93
*/
94
public function remove_bottom_margin( $class, $id, $settings ) {
95
if ( isset( $settings["navigation"] ) && $settings['navigation'] == 'false' ) {
105
/**
106
* Return css to ensure our slides are rendered correctly in the carousel
107
*
108
+ * @param string $css Css
109
+ * @param array $settings Css settings
110
+ * @param integer $slider_id SliderID
111
* @return string $css
112
*/
113
public function get_carousel_css( $css, $settings, $slider_id ) {
125
/**
126
* Enable the parameters that are accepted by the slider
127
*
128
+ * @param string $param Parameters
129
* @return array|boolean enabled parameters (false if parameter doesn't exist)
130
*/
131
protected function get_param( $param ) {
inc/slider/metaslider.nivo.class.php CHANGED
@@ -15,6 +15,9 @@ class MetaNivoSlider extends MetaSlider {
15
16
/**
17
* Constructor
18
*/
19
public function __construct( $id, $shortcode_settings ) {
20
parent::__construct( $id, $shortcode_settings );
@@ -26,6 +29,10 @@ class MetaNivoSlider extends MetaSlider {
26
* Other slides use "AutoPlay = true" (true autoplays the slideshow)
27
* Nivo slider uses "ManualAvance = false" (ie, false autoplays the slideshow)
28
* Take care of the manualAdvance parameter here.
29
*/
30
public function set_autoplay_parameter( $options, $slider_id, $settings ) {
31
global $wp_filter;
@@ -48,6 +55,7 @@ class MetaNivoSlider extends MetaSlider {
48
* Detect whether thie slide supports the requested setting,
49
* and if so, the name to use for the setting in the Javascript parameters
50
*
51
* @return false (parameter not supported) or parameter name (parameter supported)
52
*/
53
protected function get_param( $param ) {
@@ -74,7 +82,7 @@ class MetaNivoSlider extends MetaSlider {
74
}
75
76
/**
77
- *
78
*/
79
public function enqueue_scripts() {
80
parent::enqueue_scripts();
@@ -86,7 +94,9 @@ class MetaNivoSlider extends MetaSlider {
86
}
87
88
/**
89
*
90
*/
91
private function get_theme() {
92
$theme = $this->get_setting( 'theme' );
15
16
/**
17
* Constructor
18
+ *
19
+ * @param int $id ID
20
+ * @param array $shortcode_settings Short Settings
21
*/
22
public function __construct( $id, $shortcode_settings ) {
23
parent::__construct( $id, $shortcode_settings );
29
* Other slides use "AutoPlay = true" (true autoplays the slideshow)
30
* Nivo slider uses "ManualAvance = false" (ie, false autoplays the slideshow)
31
* Take care of the manualAdvance parameter here.
32
+ *
33
+ * @param array $options Options for autoplay
34
+ * @param array $slider_id Slider ID
35
+ * @param array $settings Settings
36
*/
37
public function set_autoplay_parameter( $options, $slider_id, $settings ) {
38
global $wp_filter;
55
* Detect whether thie slide supports the requested setting,
56
* and if so, the name to use for the setting in the Javascript parameters
57
*
58
+ * @param array $param Parameters
59
* @return false (parameter not supported) or parameter name (parameter supported)
60
*/
61
protected function get_param( $param ) {
82
}
83
84
/**
85
+ * enqueue scripts
86
*/
87
public function enqueue_scripts() {
88
parent::enqueue_scripts();
94
}
95
96
/**
97
+ * Get the theme
98
*
99
+ * @return string
100
*/
101
private function get_theme() {
102
$theme = $this->get_setting( 'theme' );
inc/slider/metaslider.responsive.class.php CHANGED
@@ -17,6 +17,7 @@ class MetaResponsiveSlider extends MetaSlider {
17
* Detect whether thie slide supports the requested setting,
18
* and if so, the name to use for the setting in the Javascript parameters
19
*
20
* @return false (parameter not supported) or parameter name (parameter supported)
21
*/
22
protected function get_param( $param ) {
17
* Detect whether thie slide supports the requested setting,
18
* and if so, the name to use for the setting in the Javascript parameters
19
*
20
+ * @param array $param Parameters
21
* @return false (parameter not supported) or parameter name (parameter supported)
22
*/
23
protected function get_param( $param ) {
languages/ml-slider.pot CHANGED
@@ -17,327 +17,335 @@ msgstr ""
17
"X-Poedit-SearchPathExcluded-0: *.js\n"
18
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
19
20
- #: src/admin/Notices.php:68
21
msgid "Always backup WordPress to avoid losing your site!"
22
msgstr ""
23
24
- #: src/admin/Notices.php:69
25
msgid "UpdraftPlus is the world's #1 backup plugin from the makers of MetaSlider. Backup to the cloud, on a schedule and restore with 1 click!"
26
msgstr ""
27
28
- #: src/admin/Notices.php:79
29
msgid "Keyy: Instant and secure logon with a wave of your phone"
30
msgstr ""
31
32
- #: src/admin/Notices.php:80
33
msgid "No more forgotten passwords. Find out more about our revolutionary new WordPress plugin"
34
msgstr ""
35
36
- #: src/admin/Notices.php:90
37
msgid "Save Time and Money. Manage multiple WordPress sites from one location."
38
msgstr ""
39
40
- #: src/admin/Notices.php:91
41
msgid "UpdraftCentral is a highly efficient way to take backup, update and manage multiple WP sites from one location"
42
msgstr ""
43
44
- #: src/admin/Notices.php:101
45
msgid "Like MetaSlider and have a minute to spare?"
46
msgstr ""
47
48
- #: src/admin/Notices.php:102
49
msgid "Please help MetaSlider by giving a positive review at wordpress.org."
50
msgstr ""
51
52
- #: src/admin/Notices.php:111
53
msgid "Help us to get even better MetaSlider"
54
msgstr ""
55
56
- #: src/admin/Notices.php:112
57
msgid "Let us know how you use MetaSlider by answering 4 simple questions. We will make MetaSlider to suit you better."
58
msgstr ""
59
60
- #: src/admin/Notices.php:121
61
msgid "Spice up your site with animated layers and video slides"
62
msgstr ""
63
64
- #: src/admin/Notices.php:122
65
msgid "With the MetaSlider Add-on pack you can give your slideshows a professional look!"
66
msgstr ""
67
68
- #: src/admin/Notices.php:131
69
msgid "Increase your revenue and conversion with video slides and many more features"
70
msgstr ""
71
72
- #: src/admin/Notices.php:132
73
msgid "Upgrade today to benefit from many more premium features. Find out more."
74
msgstr ""
75
76
- #: src/admin/Notices.php:141
77
msgid "Can you translate? Want to improve MetaSlider for speakers of your language?"
78
msgstr ""
79
80
- #: src/admin/Notices.php:142
81
msgid "Please go here for instructions - it is easy."
82
msgstr ""
83
84
- #: src/admin/Notices.php:152
85
msgid "Thank you for installing MetaSlider"
86
msgstr ""
87
88
- #: src/admin/Notices.php:153
89
msgid "Supercharge & secure your WordPress site with our other top plugins:"
90
msgstr ""
91
92
- #: src/admin/Notices.php:170
93
msgid "We’re making changes and need your help."
94
msgstr ""
95
96
- #: src/admin/Notices.php:171
97
msgid "If you could spare a minute, we would like to ask you 4 easy questions about how you use MetaSlider. Your voice is important to us!"
98
msgstr ""
99
100
- #: src/admin/Notices.php:176
101
msgid "forever"
102
msgstr ""
103
104
- #: src/admin/Notices.php:190
105
msgid "Black Friday - 50% off the MetaSlider Add-on Pack until November 30th"
106
msgstr ""
107
108
- #: src/admin/Notices.php:191, src/admin/Notices.php:204, src/admin/Notices.php:217, src/admin/Notices.php:230, src/admin/Notices.php:243
109
msgid "To benefit, use this discount code:"
110
msgstr ""
111
112
- #: src/admin/Notices.php:199, src/admin/Notices.php:212, src/admin/Notices.php:225, src/admin/Notices.php:238, src/admin/Notices.php:251
113
msgid "until next year"
114
msgstr ""
115
116
- #: src/admin/Notices.php:203
117
msgid "Christmas sale - 50% off the MetaSlider Add-on Pack until December 25th"
118
msgstr ""
119
120
- #: src/admin/Notices.php:216
121
msgid "Happy New Year - 50% off the MetaSlider Add-on Pack until January 1st"
122
msgstr ""
123
124
- #: src/admin/Notices.php:229
125
msgid "Spring sale - 50% off the MetaSlider Add-on Pack until April 31st"
126
msgstr ""
127
128
- #: src/admin/Notices.php:242
129
msgid "Summer sale - 50% off the MetaSlider Add-on Pack until July 31st"
130
msgstr ""
131
132
- #: src/admin/Notices.php:265
133
msgid "Increase your conversion rate with video slides and many more options."
134
msgstr ""
135
136
- #: src/admin/Notices.php:272
137
msgid "offers unparalleled choice and flexibility, allowing you to select one or a combination of over a dozen optimization options."
138
msgstr ""
139
140
- #: src/admin/Notices.php:279
141
msgid "provides personal support, the ability to copy sites, more storage destinations, encrypted backups for security, multiple backup destinations, better reporting, no adverts and plenty more."
142
msgstr ""
143
144
- #: src/admin/Notices.php:286
145
msgid "simplifies backups and restoration. It is the world's highest ranking and most popular scheduled backup plugin, with over a million currently-active installs."
146
msgstr ""
147
148
- #: src/admin/Notices.php:293
149
msgid "auto-clean your WordPress database so that it runs at maximum efficiency."
150
msgstr ""
151
152
- #: src/admin/Notices.php:300
153
msgid "Simple & secure login with a wave of your phone."
154
msgstr ""
155
156
- #: src/admin/Notices.php:307
157
msgid "is a highly efficient way to manage, update and backup multiple websites from one place."
158
msgstr ""
159
160
- #: src/admin/Notices.php:512
161
msgid "weeks"
162
msgstr ""
163
164
- #: src/admin/Notices.php:527
165
msgid "Get UpdraftPlus"
166
msgstr ""
167
168
- #: src/admin/Notices.php:528
169
msgid "Get Keyy"
170
msgstr ""
171
172
- #: src/admin/Notices.php:529
173
msgid "Optimize today"
174
msgstr ""
175
176
- #: src/admin/Notices.php:530
177
msgid "Get UpdraftCentral"
178
msgstr ""
179
180
- #: src/admin/Notices.php:531
181
msgid "Let's Start"
182
msgstr ""
183
184
- #: src/admin/Notices.php:532
185
msgid "Review MetaSlider"
186
msgstr ""
187
188
- #: src/admin/Notices.php:533
189
msgid "Find out more"
190
msgstr ""
191
192
- #: src/admin/Notices.php:534
193
msgid "Sign up"
194
msgstr ""
195
196
- #: src/admin/Notices.php:535
197
msgid "Go there"
198
msgstr ""
199
200
- #: src/admin/Notices.php:537
201
msgid "Read more"
202
msgstr ""
203
204
- #: src/admin/Notices.php:550, src/admin/Tour.php:119, src/inc/slide/metaslide.class.php:113, src/inc/slide/metaslide.image.class.php:107, src/ml-slider.php:615, src/ml-slider.php:661
205
msgid "The security check failed. Please refresh the page and try again."
206
msgstr ""
207
208
- #: src/admin/Notices.php:556
209
msgid "This item does not exist. Please refresh the page and try again."
210
msgstr ""
211
212
- #: src/admin/Notices.php:569
213
msgid "The option was successfully updated"
214
msgstr ""
215
216
- #: src/admin/Notices.php:622
217
msgid "The requested data does not exist."
218
msgstr ""
219
220
- #: src/admin/Notices.php:640
221
msgid "The attempt to update the option failed."
222
msgstr ""
223
224
- #: src/admin/Pages.php:71, src/inc/slide/metaslide.image.class.php:229
225
msgid "URL"
226
msgstr ""
227
228
- #: src/admin/Pages.php:72, src/inc/slide/metaslide.image.class.php:228
229
msgid "Caption"
230
msgstr ""
231
232
- #: src/admin/Pages.php:73, src/inc/slide/metaslide.image.class.php:231
233
msgid "New Window"
234
msgstr ""
235
236
- #: src/admin/Pages.php:74
237
msgid "Are you sure?"
238
msgstr ""
239
240
- #: src/admin/Pages.php:75
241
msgid "Undo"
242
msgstr ""
243
244
- #: src/admin/Pages.php:76
245
msgid "Slide restored"
246
msgstr ""
247
248
- #: src/admin/Pages.php:77
249
msgid "Slide deleted"
250
msgstr ""
251
252
- #: src/admin/Pages.php:78
253
msgid "Press to undo"
254
msgstr ""
255
256
- #: src/admin/Pages.php:80
257
msgid "Select replacement image"
258
msgstr ""
259
260
- #: src/admin/Pages.php:88
261
msgid "Caution: This setting is for advanced developers only. If you're unsure, leave it checked."
262
msgstr ""
263
264
- #: src/admin/Tour.php:38
265
msgid "Welcome"
266
msgstr ""
267
268
- #: src/admin/Tour.php:39
269
msgid "Thanks for using the MetaSlider WordPress plugin. It looks like you don’t have any slideshows yet! To get started, click above to add your first one."
270
msgstr ""
271
272
- #: src/admin/Tour.php:45, src/ml-slider.php:1010
273
msgid "Learn More"
274
msgstr ""
275
276
- #: src/admin/Tour.php:46, src/inc/slider/metaslider.class.php:109
277
msgid "Next"
278
msgstr ""
279
280
- #: src/admin/Tour.php:47
281
msgid "Skip this step"
282
msgstr ""
283
284
- #: src/admin/Tour.php:51
285
msgid "Add A Slide"
286
msgstr ""
287
288
- #: src/admin/Tour.php:52
289
msgid "Congratulations! Now that you've created a slideshow, click here to add a slide."
290
msgstr ""
291
292
- #: src/admin/Tour.php:55
293
msgid "Select Slide Type"
294
msgstr ""
295
296
- #: src/admin/Tour.php:56
297
msgid "Premium users that have the Add-on Pack activated can access additional slide types!"
298
msgstr ""
299
300
- #: src/admin/Tour.php:59
301
msgid "Select Media"
302
msgstr ""
303
304
- #: src/admin/Tour.php:60
305
msgid "After you have selected your media from the left, click below to continue."
306
msgstr ""
307
308
- #: src/admin/Tour.php:63, src/ml-slider.php:1338
309
msgid "Preview Slideshow"
310
msgstr ""
311
312
- #: src/admin/Tour.php:64
313
msgid "Now that you have some slides set, you can preview your slideshow by clicking here."
314
msgstr ""
315
316
- #: src/admin/Tour.php:67
317
msgid "Adjust Settings"
318
msgstr ""
319
320
- #: src/admin/Tour.php:68
321
msgid "If you need to adjust the settings for this slideshow, you may do so here."
322
msgstr ""
323
324
- #: src/admin/Tour.php:71
325
msgid "Shortcode Usage"
326
msgstr ""
327
328
- #: src/admin/Tour.php:72
329
msgid "You are all set! If you want to add the slideshow to a post, you may use this shortcode."
330
msgstr ""
331
332
- #: src/admin/Tour.php:76
333
msgid "Congratulations!"
334
msgstr ""
335
336
- #: src/admin/Tour.php:77
337
msgid "You've completed the tour and are ready to add great slideshows to your website. Don't forget, if you want your slideshows to really stand out, pick up the add-on pack today. "
338
msgstr ""
339
340
- #: src/admin/Tour.php:126
341
msgid "This method does not exist. Please refresh the page and try again."
342
msgstr ""
343
@@ -349,251 +357,251 @@ msgstr ""
349
msgid "Logo"
350
msgstr ""
351
352
- #: src/admin