Cyclone Slider - Version 2.10.3

Version Description

  • Fix. Fixed fatal error when ZipArchive is missing from PHP.
  • New. Added 'cyclone_slider_services' filter.
Download this release

Release Info

Developer kosinix
Plugin Icon 128x128 Cyclone Slider
Version 2.10.3
Comparing to
See all releases

Code changes from version 2.10.2 to 2.10.3

README.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.codefleet.net/donate/
4
  Tags: slider, slideshow, drag-and-drop, wordpress-slider, wordpress-slideshow, cycle 2, jquery, responsive, translation-ready, custom-post, cyclone-slider
5
  Requires at least: 3.5
6
  Tested up to: 4.4.2
7
- Stable tag: 2.10.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -103,6 +103,10 @@ Inside `wp-content` create a folder named "cycloneslider". Add your templates in
103
 
104
  == Changelog ==
105
 
 
 
 
 
106
  = 2.10.2 =
107
  * Fix. Fixed error opening zip file in exporter.
108
 
4
  Tags: slider, slideshow, drag-and-drop, wordpress-slider, wordpress-slideshow, cycle 2, jquery, responsive, translation-ready, custom-post, cyclone-slider
5
  Requires at least: 3.5
6
  Tested up to: 4.4.2
7
+ Stable tag: 2.10.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
103
 
104
  == Changelog ==
105
 
106
+ = 2.10.3 =
107
+ * Fix. Fixed fatal error when ZipArchive is missing from PHP.
108
+ * New. Added 'cyclone_slider_services' filter.
109
+
110
  = 2.10.2 =
111
  * Fix. Fixed error opening zip file in exporter.
112
 
cyclone-slider.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Cyclone Slider 2
4
  Plugin URI: http://www.codefleet.net/cyclone-slider-2/
5
  Description: Create and manage sliders with ease. Built for both casual users and developers.
6
- Version: 2.10.2
7
  Author: Nico Amarilla
8
  Author URI: http://www.codefleet.net/
9
  License:
@@ -42,7 +42,7 @@ $cyclone_slider_saved_done = false;
42
  add_action('plugins_loaded', 'cycloneslider_init');
43
  function cycloneslider_init() {
44
  global $cyclone_slider_plugin_instance;
45
-
46
  $plugin = new CycloneSlider_Plugin();
47
 
48
  $plugin['path'] = realpath(plugin_dir_path(__FILE__)) . DIRECTORY_SEPARATOR;
@@ -89,9 +89,6 @@ function cycloneslider_init() {
89
  $plugin['imports_extracts_dir'] = $plugin['imports_dir'].'/extracts';
90
  $plugin['import_zip_name'] = 'import.zip';
91
 
92
-
93
- $plugin['zip_archive'] = 'ZipArchive';
94
-
95
  // Order is important. core is overridden by active-theme which in turn is overridden by wp-content.
96
  $plugin['template_locations'] = array(
97
  array(
@@ -175,7 +172,8 @@ function cycloneslider_init() {
175
  $plugin['widgets'] = new CycloneSlider_Widgets();
176
 
177
  require_once($plugin['path'].'src/functions.php'); // Function not autoloaded from the old days. Deprecated
178
-
 
179
  $plugin->run();
180
 
181
  $cyclone_slider_plugin_instance = $plugin;
@@ -400,7 +398,7 @@ function cycloneslider_service_export_page_nextgen( $plugin ) {
400
  }
401
 
402
  function cycloneslider_service_zip_archive( $plugin ){
403
- return new ZipArchive;
404
  }
405
 
406
  function cycloneslider_service_asset_loader( $plugin ) {
3
  Plugin Name: Cyclone Slider 2
4
  Plugin URI: http://www.codefleet.net/cyclone-slider-2/
5
  Description: Create and manage sliders with ease. Built for both casual users and developers.
6
+ Version: 2.10.3
7
  Author: Nico Amarilla
8
  Author URI: http://www.codefleet.net/
9
  License:
42
  add_action('plugins_loaded', 'cycloneslider_init');
43
  function cycloneslider_init() {
44
  global $cyclone_slider_plugin_instance;
45
+
46
  $plugin = new CycloneSlider_Plugin();
47
 
48
  $plugin['path'] = realpath(plugin_dir_path(__FILE__)) . DIRECTORY_SEPARATOR;
89
  $plugin['imports_extracts_dir'] = $plugin['imports_dir'].'/extracts';
90
  $plugin['import_zip_name'] = 'import.zip';
91
 
 
 
 
92
  // Order is important. core is overridden by active-theme which in turn is overridden by wp-content.
93
  $plugin['template_locations'] = array(
94
  array(
172
  $plugin['widgets'] = new CycloneSlider_Widgets();
173
 
174
  require_once($plugin['path'].'src/functions.php'); // Function not autoloaded from the old days. Deprecated
175
+
176
+
177
  $plugin->run();
178
 
179
  $cyclone_slider_plugin_instance = $plugin;
398
  }
399
 
400
  function cycloneslider_service_zip_archive( $plugin ){
401
+ return 'ZipArchive';
402
  }
403
 
404
  function cycloneslider_service_asset_loader( $plugin ) {
lang/cycloneslider.pot CHANGED
@@ -2,8 +2,8 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Cyclone Slider\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2016-02-05 13:42+0800\n"
6
- "PO-Revision-Date: 2016-02-05 13:42+0800\n"
7
  "Last-Translator: Kosinix <kosinix@codefleet.net>\n"
8
  "Language-Team: kosinix <kosinix@codefleet.net>\n"
9
  "Language: en_US\n"
@@ -17,38 +17,38 @@ msgstr ""
17
  "X-Poedit-SearchPath-0: .\n"
18
  "X-Poedit-SearchPath-1: ..\n"
19
 
20
- #: ../cyclone-slider.php:117
21
  msgid "Cyclone Slider Settings"
22
  msgstr ""
23
 
24
- #: ../cyclone-slider.php:118
25
  msgid "Settings"
26
  msgstr ""
27
 
28
- #: ../cyclone-slider.php:128
29
  msgid "Cyclone Slider Export"
30
  msgstr ""
31
 
32
- #: ../cyclone-slider.php:129
33
  msgid "Export/Import"
34
  msgstr ""
35
 
36
- #: ../cyclone-slider.php:141
37
  msgid "Cyclone Slider Nextgen Export"
38
  msgstr ""
39
 
40
- #: ../cyclone-slider.php:142 ../src/CycloneSlider/ExportPageNextgen.php:75
41
  msgid "Export Nextgen"
42
  msgstr ""
43
 
44
- #: ../cyclone-slider.php:154
45
  msgid "Cyclone Slider Import"
46
  msgstr ""
47
 
48
- #: ../cyclone-slider.php:155 ../src/CycloneSlider/ExportPage.php:72
49
  #: ../src/CycloneSlider/ExportPageNextgen.php:70
50
  #: ../src/CycloneSlider/ExporterNextgen.php:65
51
- #: ../src/CycloneSlider/ImportPage.php:74
52
  #: ../src/CycloneSlider/NextgenIntegration.php:65
53
  msgid "Import"
54
  msgstr ""
@@ -219,26 +219,32 @@ msgstr ""
219
 
220
  #: ../src/CycloneSlider/ExportPage.php:67
221
  #: ../src/CycloneSlider/ExportPageNextgen.php:65
222
- #: ../src/CycloneSlider/ImportPage.php:69
223
  msgid "Export"
224
  msgstr ""
225
 
226
- #: ../src/CycloneSlider/ExportPage.php:114
 
 
 
 
 
 
227
  #: ../src/CycloneSlider/ExportPageNextgen.php:121
228
  msgid "Your export file is ready. Click Download."
229
  msgstr ""
230
 
231
- #: ../src/CycloneSlider/ExportPage.php:119
232
  #: ../src/CycloneSlider/ExportPageNextgen.php:126
233
  msgid "Error creating exports directory."
234
  msgstr ""
235
 
236
- #: ../src/CycloneSlider/ExportPage.php:168
237
  #: ../src/CycloneSlider/ExportPageNextgen.php:175
238
  msgid "No slider selected."
239
  msgstr ""
240
 
241
- #: ../src/CycloneSlider/ExportPage.php:173
242
  #: ../src/CycloneSlider/ExportPageNextgen.php:180
243
  msgid "Please choose a file name."
244
  msgstr ""
@@ -317,7 +323,7 @@ msgstr ""
317
  msgid "[Template \"%s\" not found]"
318
  msgstr ""
319
 
320
- #: ../src/CycloneSlider/ImportPage.php:116
321
  msgid "Import operation success!"
322
  msgstr ""
323
 
@@ -337,34 +343,34 @@ msgstr ""
337
  msgid "Error moving uploaded zip."
338
  msgstr ""
339
 
340
- #: ../src/CycloneSlider/Importer.php:62
341
  #, php-format
342
  msgid "Error opening zip: %s"
343
  msgstr ""
344
 
345
- #: ../src/CycloneSlider/Importer.php:68
346
  msgid "Error extracting zip."
347
  msgstr ""
348
 
349
- #: ../src/CycloneSlider/Importer.php:75
350
  msgid "Failed to read export JSON."
351
  msgstr ""
352
 
353
- #: ../src/CycloneSlider/Importer.php:80
354
  msgid "Failed to decode JSON."
355
  msgstr ""
356
 
357
- #: ../src/CycloneSlider/Importer.php:151
358
  #, php-format
359
  msgid "scandir failed on %s"
360
  msgstr ""
361
 
362
- #: ../src/CycloneSlider/Importer.php:167
363
  #, php-format
364
  msgid "Source image %s not found."
365
  msgstr ""
366
 
367
- #: ../src/CycloneSlider/Importer.php:171
368
  msgid "Copy error."
369
  msgstr ""
370
 
2
  msgstr ""
3
  "Project-Id-Version: Cyclone Slider\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2016-02-07 13:37+0800\n"
6
+ "PO-Revision-Date: 2016-02-07 13:37+0800\n"
7
  "Last-Translator: Kosinix <kosinix@codefleet.net>\n"
8
  "Language-Team: kosinix <kosinix@codefleet.net>\n"
9
  "Language: en_US\n"
17
  "X-Poedit-SearchPath-0: .\n"
18
  "X-Poedit-SearchPath-1: ..\n"
19
 
20
+ #: ../cyclone-slider.php:114
21
  msgid "Cyclone Slider Settings"
22
  msgstr ""
23
 
24
+ #: ../cyclone-slider.php:115
25
  msgid "Settings"
26
  msgstr ""
27
 
28
+ #: ../cyclone-slider.php:125
29
  msgid "Cyclone Slider Export"
30
  msgstr ""
31
 
32
+ #: ../cyclone-slider.php:126
33
  msgid "Export/Import"
34
  msgstr ""
35
 
36
+ #: ../cyclone-slider.php:138
37
  msgid "Cyclone Slider Nextgen Export"
38
  msgstr ""
39
 
40
+ #: ../cyclone-slider.php:139 ../src/CycloneSlider/ExportPageNextgen.php:75
41
  msgid "Export Nextgen"
42
  msgstr ""
43
 
44
+ #: ../cyclone-slider.php:151
45
  msgid "Cyclone Slider Import"
46
  msgstr ""
47
 
48
+ #: ../cyclone-slider.php:152 ../src/CycloneSlider/ExportPage.php:72
49
  #: ../src/CycloneSlider/ExportPageNextgen.php:70
50
  #: ../src/CycloneSlider/ExporterNextgen.php:65
51
+ #: ../src/CycloneSlider/ImportPage.php:77
52
  #: ../src/CycloneSlider/NextgenIntegration.php:65
53
  msgid "Import"
54
  msgstr ""
219
 
220
  #: ../src/CycloneSlider/ExportPage.php:67
221
  #: ../src/CycloneSlider/ExportPageNextgen.php:65
222
+ #: ../src/CycloneSlider/ImportPage.php:72
223
  msgid "Export"
224
  msgstr ""
225
 
226
+ #: ../src/CycloneSlider/ExportPage.php:80
227
+ #: ../src/CycloneSlider/ImportPage.php:66
228
+ msgid ""
229
+ "ZipArchive not supported. ZipArchive is needed for Import and Export to work."
230
+ msgstr ""
231
+
232
+ #: ../src/CycloneSlider/ExportPage.php:116
233
  #: ../src/CycloneSlider/ExportPageNextgen.php:121
234
  msgid "Your export file is ready. Click Download."
235
  msgstr ""
236
 
237
+ #: ../src/CycloneSlider/ExportPage.php:121
238
  #: ../src/CycloneSlider/ExportPageNextgen.php:126
239
  msgid "Error creating exports directory."
240
  msgstr ""
241
 
242
+ #: ../src/CycloneSlider/ExportPage.php:170
243
  #: ../src/CycloneSlider/ExportPageNextgen.php:175
244
  msgid "No slider selected."
245
  msgstr ""
246
 
247
+ #: ../src/CycloneSlider/ExportPage.php:175
248
  #: ../src/CycloneSlider/ExportPageNextgen.php:180
249
  msgid "Please choose a file name."
250
  msgstr ""
323
  msgid "[Template \"%s\" not found]"
324
  msgstr ""
325
 
326
+ #: ../src/CycloneSlider/ImportPage.php:119
327
  msgid "Import operation success!"
328
  msgstr ""
329
 
343
  msgid "Error moving uploaded zip."
344
  msgstr ""
345
 
346
+ #: ../src/CycloneSlider/Importer.php:63
347
  #, php-format
348
  msgid "Error opening zip: %s"
349
  msgstr ""
350
 
351
+ #: ../src/CycloneSlider/Importer.php:69
352
  msgid "Error extracting zip."
353
  msgstr ""
354
 
355
+ #: ../src/CycloneSlider/Importer.php:76
356
  msgid "Failed to read export JSON."
357
  msgstr ""
358
 
359
+ #: ../src/CycloneSlider/Importer.php:81
360
  msgid "Failed to decode JSON."
361
  msgstr ""
362
 
363
+ #: ../src/CycloneSlider/Importer.php:152
364
  #, php-format
365
  msgid "scandir failed on %s"
366
  msgstr ""
367
 
368
+ #: ../src/CycloneSlider/Importer.php:168
369
  #, php-format
370
  msgid "Source image %s not found."
371
  msgstr ""
372
 
373
+ #: ../src/CycloneSlider/Importer.php:172
374
  msgid "Copy error."
375
  msgstr ""
376
 
src/CycloneSlider/ExportPage.php CHANGED
@@ -75,7 +75,12 @@ class CycloneSlider_ExportPage extends CycloneSlider_WpAdminSubPage{
75
  )
76
  );
77
  $vars['page_data'] = $this->get_page_data();
78
-
 
 
 
 
 
79
  switch ( $current_step ) {
80
  case 1:
81
  $this->render_step_1( $vars );
@@ -92,15 +97,12 @@ class CycloneSlider_ExportPage extends CycloneSlider_WpAdminSubPage{
92
  private function render_step_1( $vars ){
93
 
94
  $vars['sliders'] = $this->sliders;
95
- $vars['error'] = get_transient( 'cycloneslider_error_export');
96
- delete_transient( 'cycloneslider_error_export');
97
  $this->view->render( 'export-step-1.php', $vars );
98
 
99
  }
100
  private function render_step_2( $vars ){
101
-
102
- $vars['error'] = get_transient( 'cycloneslider_error_export');
103
- delete_transient( 'cycloneslider_error_export');
104
  $this->view->render( 'export-step-2.php', $vars );
105
  }
106
 
75
  )
76
  );
77
  $vars['page_data'] = $this->get_page_data();
78
+ $vars['error'] = get_transient( 'cycloneslider_error_export');
79
+ if(!class_exists('ZipArchive')){
80
+ $vars['error'] = __( 'ZipArchive not supported. ZipArchive is needed for Import and Export to work.', $this->textdomain );
81
+ }
82
+ delete_transient( 'cycloneslider_error_export');
83
+
84
  switch ( $current_step ) {
85
  case 1:
86
  $this->render_step_1( $vars );
97
  private function render_step_1( $vars ){
98
 
99
  $vars['sliders'] = $this->sliders;
100
+
 
101
  $this->view->render( 'export-step-1.php', $vars );
102
 
103
  }
104
  private function render_step_2( $vars ){
105
+
 
 
106
  $this->view->render( 'export-step-2.php', $vars );
107
  }
108
 
src/CycloneSlider/Exporter.php CHANGED
@@ -175,8 +175,8 @@ class CycloneSlider_Exporter {
175
  if( !class_exists('ZipArchive') ) {
176
  throw new Exception( __( 'ZipArchive not supported.', $this->textdomain ) );
177
  }
178
- $zip = new $this->zip_archive();
179
-
180
  $result = $zip->open( $zip_file, ZipArchive::CREATE | ZipArchive::OVERWRITE );
181
  if ( true !== $result ) {
182
  throw new Exception( sprintf( __( 'Error opening zip file %s. Code: %s', $this->textdomain ), $zip_file, $result ) );
175
  if( !class_exists('ZipArchive') ) {
176
  throw new Exception( __( 'ZipArchive not supported.', $this->textdomain ) );
177
  }
178
+ $zip_archive_class_name = $this->zip_archive;
179
+ $zip = new $zip_archive_class_name();
180
  $result = $zip->open( $zip_file, ZipArchive::CREATE | ZipArchive::OVERWRITE );
181
  if ( true !== $result ) {
182
  throw new Exception( sprintf( __( 'Error opening zip file %s. Code: %s', $this->textdomain ), $zip_file, $result ) );
src/CycloneSlider/ImportPage.php CHANGED
@@ -62,6 +62,9 @@ class CycloneSlider_ImportPage extends CycloneSlider_WpAdminSubPage {
62
  $vars['import_page_url'] = $this->import_page_url;
63
  $vars['nextgen_page_url'] = $this->nextgen_page_url;
64
  $vars['error'] = get_transient( 'cycloneslider_error_import');
 
 
 
65
  delete_transient( 'cycloneslider_error_import');
66
 
67
  $vars['tabs'] = array(
62
  $vars['import_page_url'] = $this->import_page_url;
63
  $vars['nextgen_page_url'] = $this->nextgen_page_url;
64
  $vars['error'] = get_transient( 'cycloneslider_error_import');
65
+ if(!class_exists('ZipArchive')){
66
+ $vars['error'] = __( 'ZipArchive not supported. ZipArchive is needed for Import and Export to work.', $this->textdomain );
67
+ }
68
  delete_transient( 'cycloneslider_error_import');
69
 
70
  $vars['tabs'] = array(
src/CycloneSlider/Importer.php CHANGED
@@ -56,7 +56,8 @@ class CycloneSlider_Importer {
56
  }
57
 
58
  // Open zip and perform checks
59
- $zip = new $this->zip_archive;
 
60
  $zip_result = $zip->open( $zip_file, ZipArchive::CHECKCONS);
61
  if( true !== $zip_result ){
62
  throw new Exception( sprintf( __('Error opening zip: %s', $this->textdomain), $this->get_zip_error( $zip_result ) ), 4);
56
  }
57
 
58
  // Open zip and perform checks
59
+ $zip_archive_class_name = $this->zip_archive;
60
+ $zip = new $zip_archive_class_name();
61
  $zip_result = $zip->open( $zip_file, ZipArchive::CHECKCONS);
62
  if( true !== $zip_result ){
63
  throw new Exception( sprintf( __('Error opening zip: %s', $this->textdomain), $this->get_zip_error( $zip_result ) ), 4);
src/CycloneSlider/Plugin.php CHANGED
@@ -26,7 +26,8 @@ class CycloneSlider_Plugin implements ArrayAccess {
26
  return isset($this->contents[$offset]) ? $this->contents[$offset] : null;
27
  }
28
 
29
- public function run(){
 
30
  // Loop on contents
31
  foreach($this->contents as $key=>$content){
32
  if( is_callable($content) ){
26
  return isset($this->contents[$offset]) ? $this->contents[$offset] : null;
27
  }
28
 
29
+ public function run(){
30
+ $this->contents = apply_filters('cyclone_slider_services', $this->contents);
31
  // Loop on contents
32
  foreach($this->contents as $key=>$content){
33
  if( is_callable($content) ){