Elementor Addons & Templates – Sizzify Lite - Version 1.3.1

Version Description

  • 2019-04-17
Download this release

Release Info

Developer themeisle
Plugin Icon wp plugin Elementor Addons & Templates – Sizzify Lite
Version 1.3.1
Comparing to
See all releases

Code changes from version 1.3.0 to 1.3.1

Files changed (32) hide show
  1. CHANGELOG.md +4 -0
  2. eaw-class.php +1 -1
  3. elementor-addon-widgets.php +2 -2
  4. readme.md +5 -0
  5. readme.txt +5 -0
  6. themeisle-hash.json +1 -1
  7. vendor/autoload.php +1 -1
  8. vendor/codeinwp/elementor-extra-widgets/composer.json +0 -23
  9. vendor/codeinwp/elementor-extra-widgets/phpunit.xml +0 -14
  10. vendor/codeinwp/elementor-extra-widgets/tests/bootstrap.php +0 -50
  11. vendor/codeinwp/elementor-extra-widgets/tests/test-basics.php +0 -71
  12. vendor/codeinwp/full-width-page-templates/builders/class-none-full-width-templates.php +93 -0
  13. vendor/codeinwp/full-width-page-templates/class-full-width-templates.php +19 -10
  14. vendor/codeinwp/full-width-page-templates/composer.json +0 -23
  15. vendor/codeinwp/full-width-page-templates/phpunit.xml +0 -14
  16. vendor/codeinwp/full-width-page-templates/tests/bootstrap.php +0 -50
  17. vendor/codeinwp/full-width-page-templates/tests/test-basics.php +0 -35
  18. vendor/codeinwp/templates-directory/composer.json +0 -28
  19. vendor/codeinwp/themeisle-content-forms/assets/content-forms.css +1 -0
  20. vendor/codeinwp/themeisle-content-forms/assets/content-forms.js +1 -1
  21. vendor/codeinwp/themeisle-content-forms/class-themeisle-content-forms-contact.php +32 -27
  22. vendor/codeinwp/themeisle-content-forms/class-themeisle-content-forms-newsletter.php +15 -15
  23. vendor/codeinwp/themeisle-content-forms/composer.json +0 -25
  24. vendor/codeinwp/themeisle-content-forms/phpunit.xml +0 -14
  25. vendor/codeinwp/themeisle-content-forms/tests/bootstrap.php +0 -50
  26. vendor/codeinwp/themeisle-content-forms/tests/test-basics.php +0 -86
  27. vendor/codeinwp/themeisle-content-forms/tests/test-contact-form.php +0 -113
  28. vendor/codeinwp/themeisle-content-forms/tests/test-newsletter-form.php +0 -73
  29. vendor/codeinwp/themeisle-content-forms/tests/test-registration-form.php +0 -139
  30. vendor/codeinwp/themeisle-content-forms/tests/test-server.php +0 -62
  31. vendor/composer/autoload_real.php +5 -5
  32. vendor/composer/installed.json +8 -8
CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
 
 
 
 
 
2
  ### v1.3.0 - 2019-03-08
3
  **Changes:**
4
  * Tested with latest WordPress version, 5.1
1
 
2
+ ### v1.3.1 - 2019-04-17
3
+ **Changes:**
4
+ * Fix issues with newsletter form
5
+
6
  ### v1.3.0 - 2019-03-08
7
  **Changes:**
8
  * Tested with latest WordPress version, 5.1
eaw-class.php CHANGED
@@ -63,7 +63,7 @@ class Elementor_Addon_Widgets {
63
  */
64
  public static function get_instance() {
65
 
66
- if ( null == self::$instance ) {
67
  self::$instance = new Elementor_Addon_Widgets();
68
  }
69
 
63
  */
64
  public static function get_instance() {
65
 
66
+ if ( null === self::$instance ) {
67
  self::$instance = new Elementor_Addon_Widgets();
68
  }
69
 
elementor-addon-widgets.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Elementor Addons & Templates - Sizzify Lite
4
  * Plugin URI: https://themeisle.com/
5
  * Description: Adds new Addons & Widgets that are specifically designed to be used in conjunction with the Elementor Page Builder.
6
- * Version: 1.3.0
7
  * Author: ThemeIsle
8
  * Author URI: https://themeisle.com/
9
  * Requires at least: 4.4
@@ -23,7 +23,7 @@ Constants
23
  ------------------------------------------ */
24
 
25
  /* Set plugin version constant. */
26
- define( 'EA_VERSION', '1.3.0' );
27
 
28
  /* Set constant path to the plugin directory. */
29
  define( 'EA_PATH', trailingslashit( plugin_dir_path( __FILE__ ) ) );
3
  * Plugin Name: Elementor Addons & Templates - Sizzify Lite
4
  * Plugin URI: https://themeisle.com/
5
  * Description: Adds new Addons & Widgets that are specifically designed to be used in conjunction with the Elementor Page Builder.
6
+ * Version: 1.3.1
7
  * Author: ThemeIsle
8
  * Author URI: https://themeisle.com/
9
  * Requires at least: 4.4
23
  ------------------------------------------ */
24
 
25
  /* Set plugin version constant. */
26
+ define( 'EA_VERSION', '1.3.1' );
27
 
28
  /* Set constant path to the plugin directory. */
29
  define( 'EA_PATH', trailingslashit( plugin_dir_path( __FILE__ ) ) );
readme.md CHANGED
@@ -61,6 +61,11 @@ See this [issue #495](https://github.com/pojome/elementor/issues/495) for curren
61
  4. Frontend view posts with custom title.
62
 
63
  ## Changelog ##
 
 
 
 
 
64
  ### 1.3.0 - 2019-03-08 ###
65
 
66
  * Tested with latest WordPress version, 5.1
61
  4. Frontend view posts with custom title.
62
 
63
  ## Changelog ##
64
+ ### 1.3.1 - 2019-04-17 ###
65
+
66
+ * Fix issues with newsletter form
67
+
68
+
69
  ### 1.3.0 - 2019-03-08 ###
70
 
71
  * Tested with latest WordPress version, 5.1
readme.txt CHANGED
@@ -61,6 +61,11 @@ See this [issue #495](https://github.com/pojome/elementor/issues/495) for curren
61
  4. Frontend view posts with custom title.
62
 
63
  == Changelog ==
 
 
 
 
 
64
  = 1.3.0 - 2019-03-08 =
65
 
66
  * Tested with latest WordPress version, 5.1
61
  4. Frontend view posts with custom title.
62
 
63
  == Changelog ==
64
+ = 1.3.1 - 2019-04-17 =
65
+
66
+ * Fix issues with newsletter form
67
+
68
+
69
  = 1.3.0 - 2019-03-08 =
70
 
71
  * Tested with latest WordPress version, 5.1
themeisle-hash.json CHANGED
@@ -1 +1 @@
1
- {"eaw-class.php":"7884bd92ace1bd5e8a5b1151b6dfb4a9","elementor-addon-widgets.php":"f1fa7d8d2443a0c6c2c3eaac68d144e6"}
1
+ {"eaw-class.php":"480348ee01bbcb6a8359f53876a95498","elementor-addon-widgets.php":"0dc9f362d3601de3b5f2d4fbaa732839"}
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit1949c25865d8e9f266b9f04c54d29d81::getLoader();
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitd247449b2aa8f76a384c8256504c9931::getLoader();
vendor/codeinwp/elementor-extra-widgets/composer.json DELETED
@@ -1,23 +0,0 @@
1
- {
2
- "name": "codeinwp/elementor-extra-widgets",
3
- "type": "library",
4
- "version": "1.0.2",
5
- "license": "GPL-3.0-or-later",
6
- "minimum-stability": "dev",
7
- "homepage": "https://github.com/Codeinwp/elementor-extra-widgets",
8
- "authors": [
9
- {
10
- "name": "ThemeIsle team",
11
- "email": "friends@themeisle.com",
12
- "homepage": "https://themeisle.com"
13
- }
14
- ],
15
- "autoload": {
16
- "files": [
17
- "load.php"
18
- ]
19
- },
20
- "support": {
21
- "issues": "https://github.com/Codeinwp/elementor-extra-widgets/issues"
22
- }
23
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/elementor-extra-widgets/phpunit.xml DELETED
@@ -1,14 +0,0 @@
1
- <phpunit
2
- bootstrap="tests/bootstrap.php"
3
- backupGlobals="false"
4
- colors="true"
5
- convertErrorsToExceptions="true"
6
- convertNoticesToExceptions="true"
7
- convertWarningsToExceptions="true"
8
- >
9
- <testsuites>
10
- <testsuite>
11
- <directory prefix="test-" suffix=".php">./tests/</directory>
12
- </testsuite>
13
- </testsuites>
14
- </phpunit>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/elementor-extra-widgets/tests/bootstrap.php DELETED
@@ -1,50 +0,0 @@
1
- <?php
2
- /**
3
- * PHPUnit bootstrap file
4
- *
5
- * @package ThemeIsle\ElementorExtraWidgets
6
- */
7
-
8
- /**
9
- * change PLUGIN_FILE env in phpunit.xml
10
- */
11
- define( 'PLUGIN_FILE', getenv( 'PLUGIN_FILE' ) );
12
- define( 'PLUGIN_FOLDER', basename( dirname( __DIR__ ) ) );
13
- define( 'PLUGIN_PATH', PLUGIN_FOLDER . '/' . PLUGIN_FILE );
14
-
15
- // Activates this plugin in WordPress so it can be tested.
16
- $GLOBALS['wp_tests_options'] = [
17
- 'active_plugins' => [ PLUGIN_PATH ],
18
- 'template' => 'twentysixteen',
19
- 'stylesheet' => 'twentysixteen',
20
- ];
21
-
22
- // Determine the tests directory (from a WP dev checkout).
23
- // Try the WP_TESTS_DIR environment variable first.
24
- $_tests_dir = getenv( 'WP_TESTS_DIR' );
25
-
26
- // See if we're installed inside an existing WP dev instance.
27
- if ( ! $_tests_dir ) {
28
- $_try_tests_dir = dirname( __FILE__ ) . '/../../../../../tests/phpunit';
29
- if ( file_exists( $_try_tests_dir . '/includes/functions.php' ) ) {
30
- $_tests_dir = $_try_tests_dir;
31
- }
32
- }
33
- // Fallback.
34
- if ( ! $_tests_dir ) {
35
- $_tests_dir = '/tmp/wordpress-tests-lib';
36
- }
37
-
38
- // Give access to tests_add_filter() function.
39
- require_once $_tests_dir . '/includes/functions.php';
40
-
41
- /**
42
- * Manually load the plugin being tested.
43
- */
44
- function _manually_load_plugin() {
45
- require dirname( dirname( __FILE__ ) ) . '/load.php';
46
- }
47
- tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
48
-
49
- // Start up the WP testing environment.
50
- require $_tests_dir . '/includes/bootstrap.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/elementor-extra-widgets/tests/test-basics.php DELETED
@@ -1,71 +0,0 @@
1
- <?php
2
- /**
3
- * Basic Tests
4
- *
5
- * @package ThemeIsle\ElementorExtraWidgets
6
- */
7
-
8
- /**
9
- * Test functions in register.php
10
- */
11
- class Plugin_Test extends WP_UnitTestCase {
12
-
13
- public function setUp() {
14
- parent::setUp();
15
- wp_set_current_user( $this->factory->user->create( [ 'role' => 'administrator' ] ) );
16
-
17
- do_action( 'init' );
18
- do_action( 'plugins_loaded' );
19
- }
20
-
21
- /**
22
- * Tests test_library_availability().
23
- *
24
- * @covers ElementorExtraWidgets::instance();
25
- */
26
- function test_library_availability() {
27
- $this->assertTrue( class_exists( '\ThemeIsle\ElementorExtraWidgets') );
28
- }
29
-
30
- /**
31
- * Test the right type of class instance
32
- *
33
- * @covers ElementorExtraWidgets::instance();
34
- */
35
- public function test_getInstance() {
36
- $this->assertInstanceOf( '\Themeisle\ElementorExtraWidgets', \Themeisle\ElementorExtraWidgets::instance() );
37
- }
38
-
39
- /**
40
- * Test if the library version is the same from the composer.json
41
- *
42
- * @covers ElementorExtraWidgets::$version
43
- */
44
- function test_version() {
45
- $composer_version = json_decode( file_get_contents( dirname( dirname( __FILE__ ) ) . '/composer.json' ) );
46
- $this->assertTrue( $composer_version->version === \ThemeIsle\ElementorExtraWidgets::$version );
47
- }
48
-
49
- /**
50
- * Test if the class enqueues the required assets
51
- * @covers ElementorExtraWidgets::register_assets
52
- */
53
- public function test_assets_enqueue() {
54
- $this->assertFalse( wp_script_is( 'obfx-grid-js', 'registered' ) );
55
- $this->assertFalse( wp_style_is( 'eaw-elementor', 'registered' ) );
56
- }
57
-
58
- /**
59
- * @expectedIncorrectUsage __clone
60
- */
61
- public function test_Clone() {
62
- $obj_cloned = clone \Themeisle\ElementorExtraWidgets::$instance;
63
- }
64
-
65
- /**
66
- * @expectedIncorrectUsage __wakeup
67
- */
68
- public function test_Wakeup() {
69
- unserialize( serialize( \Themeisle\ElementorExtraWidgets::$instance ) );
70
- }
71
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/full-width-page-templates/builders/class-none-full-width-templates.php ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class ThemeIsle\FullWidthTemplates\Elementor
4
+ *
5
+ * @package ThemeIsle\FullWidthTemplates\Elementor
6
+ * @copyright Copyright (c) 2017, Andrei Lupu
7
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
8
+ * @since 1.0.0
9
+ */
10
+
11
+ namespace ThemeIsle\FullWidthTemplates;
12
+
13
+ class None {
14
+ /**
15
+ * @var Elementor
16
+ */
17
+ public static $instance = null;
18
+
19
+ protected function init(){
20
+ // for the standard template
21
+ add_action( 'fwpt_std_content', array( $this, 'render_content' ) );
22
+ add_action( 'fwpt_std_before_content', array( $this, 'render_std_before_content' ) );
23
+ add_action( 'fwpt_std_after_content', array( $this, 'render_std_after_content' ) );
24
+
25
+ }
26
+
27
+ /**
28
+ * Display the WordPress loop
29
+ */
30
+ public function render_content() {
31
+ while ( have_posts() ) : the_post();
32
+ the_content();
33
+ endwhile;
34
+ }
35
+
36
+
37
+ /**
38
+ * Display the header of the standard template
39
+ */
40
+ public function render_std_before_content() {
41
+ get_header();
42
+ }
43
+
44
+ /**
45
+ * Display the footer of the standard template
46
+ */
47
+ public function render_std_after_content() {
48
+ get_footer();
49
+ }
50
+
51
+
52
+ /**
53
+ * @static
54
+ * @since 1.0.0
55
+ * @access public
56
+ * @return Elementor
57
+ */
58
+ public static function instance() {
59
+ if ( null === self::$instance ) {
60
+ self::$instance = new self();
61
+ self::$instance->init();
62
+ }
63
+
64
+ return self::$instance;
65
+ }
66
+
67
+ /**
68
+ * Throw error on object clone
69
+ *
70
+ * The whole idea of the singleton design pattern is that there is a single
71
+ * object therefore, we don't want the object to be cloned.
72
+ *
73
+ * @access public
74
+ * @since 1.0.0
75
+ * @return void
76
+ */
77
+ public function __clone() {
78
+ // Cloning instances of the class is forbidden.
79
+ _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'elementor-addon-widgets' ), '1.0.0' );
80
+ }
81
+
82
+ /**
83
+ * Disable unserializing of the class
84
+ *
85
+ * @access public
86
+ * @since 1.0.0
87
+ * @return void
88
+ */
89
+ public function __wakeup() {
90
+ // Unserializing instances of the class is forbidden.
91
+ _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'elementor-addon-widgets' ), '1.0.0' );
92
+ }
93
+ }
vendor/codeinwp/full-width-page-templates/class-full-width-templates.php CHANGED
@@ -10,6 +10,9 @@
10
 
11
  namespace ThemeIsle;
12
 
 
 
 
13
  if ( ! class_exists( '\ThemeIsle\FullWidthTemplates' ) ) {
14
 
15
  class FullWidthTemplates {
@@ -33,10 +36,11 @@ if ( ! class_exists( '\ThemeIsle\FullWidthTemplates' ) ) {
33
  * Defines the library behaviour
34
  */
35
  protected function init() {
 
36
  // Add your templates to this array.
37
  $this->templates = apply_filters( 'fwpt_templates_list', array(
38
- 'templates/builder-fullwidth.php' => '&harr; ' . __( 'Page Builder - Full Width - Blank', 'elementor-addon-widgets' ),
39
- 'templates/builder-fullwidth-std.php' => '&harr; ' . __( 'Page Builder - Full Width', 'elementor-addon-widgets' ),
40
  ) );
41
 
42
  add_filter( 'theme_page_templates', array( $this, 'add_pages_in_dropdown' ) );
@@ -92,11 +96,6 @@ if ( ! class_exists( '\ThemeIsle\FullWidthTemplates' ) ) {
92
  return $template;
93
  }
94
 
95
- protected function guess_builder(){
96
- $builder = 'elementor';
97
- return $builder;
98
- }
99
-
100
  /**
101
  * Adds our template to the pages cache in order to trick WordPress
102
  * into thinking the template file exists where it doesn't really exist.
@@ -145,17 +144,27 @@ if ( ! class_exists( '\ThemeIsle\FullWidthTemplates' ) ) {
145
  include_once( $func_filename );
146
  }
147
  }
148
-
 
 
 
 
 
149
  /**
150
  * Add support for Elementor and call the class
151
  */
152
  public function add_support_for_elementor(){
153
 
154
  // We check if the Elementor plugin has been installed / activated.
155
- if ( defined( 'ELEMENTOR_PATH' ) && class_exists( 'Elementor\Widget_Base' ) ) {
156
  require_once( dirname( __FILE__ ) . '/builders/class-elementor-full-width-templates.php' );
157
  FullWidthTemplates\Elementor::instance();
 
158
  }
 
 
 
 
159
  }
160
 
161
  /**
@@ -165,7 +174,7 @@ if ( ! class_exists( '\ThemeIsle\FullWidthTemplates' ) ) {
165
  * @return FullWidthTemplates
166
  */
167
  public static function instance() {
168
- if ( is_null( self::$instance ) ) {
169
  self::$instance = new self();
170
  self::$instance->init();
171
  }
10
 
11
  namespace ThemeIsle;
12
 
13
+ use ThemeIsle\FullWidthTemplates\Elementor;
14
+ use ThemeIsle\FullWidthTemplates\None;
15
+
16
  if ( ! class_exists( '\ThemeIsle\FullWidthTemplates' ) ) {
17
 
18
  class FullWidthTemplates {
36
  * Defines the library behaviour
37
  */
38
  protected function init() {
39
+
40
  // Add your templates to this array.
41
  $this->templates = apply_filters( 'fwpt_templates_list', array(
42
+ 'templates/builder-fullwidth.php' => html_entity_decode( '&harr; ' ) . __( 'Page Builder - Full Width - Blank', 'elementor-addon-widgets' ),
43
+ 'templates/builder-fullwidth-std.php' => html_entity_decode( '&harr; ' ) . __( 'Page Builder - Full Width', 'elementor-addon-widgets' ),
44
  ) );
45
 
46
  add_filter( 'theme_page_templates', array( $this, 'add_pages_in_dropdown' ) );
96
  return $template;
97
  }
98
 
 
 
 
 
 
99
  /**
100
  * Adds our template to the pages cache in order to trick WordPress
101
  * into thinking the template file exists where it doesn't really exist.
144
  include_once( $func_filename );
145
  }
146
  }
147
+ public function is_elementor(){
148
+ if ( defined( 'ELEMENTOR_PATH' ) && class_exists( 'Elementor\Widget_Base' ) ) {
149
+ return true;
150
+ }
151
+ return false;
152
+ }
153
  /**
154
  * Add support for Elementor and call the class
155
  */
156
  public function add_support_for_elementor(){
157
 
158
  // We check if the Elementor plugin has been installed / activated.
159
+ if( $this->is_elementor()){
160
  require_once( dirname( __FILE__ ) . '/builders/class-elementor-full-width-templates.php' );
161
  FullWidthTemplates\Elementor::instance();
162
+ return;
163
  }
164
+
165
+ require_once( dirname( __FILE__ ) . '/builders/class-none-full-width-templates.php' );
166
+ FullWidthTemplates\None::instance();
167
+ return;
168
  }
169
 
170
  /**
174
  * @return FullWidthTemplates
175
  */
176
  public static function instance() {
177
+ if ( null === self::$instance ) {
178
  self::$instance = new self();
179
  self::$instance->init();
180
  }
vendor/codeinwp/full-width-page-templates/composer.json DELETED
@@ -1,23 +0,0 @@
1
- {
2
- "name": "codeinwp/full-width-page-templates",
3
- "description": "A WordPress library to create full width page templates.",
4
- "type": "library",
5
- "version": "1.0.2",
6
- "license": "GPL-2.0-or-later",
7
- "homepage": "https://github.com/Codeinwp/full-width-page-templates",
8
- "authors": [
9
- {
10
- "name": "ThemeIsle team",
11
- "email": "friends@themeisle.com",
12
- "homepage": "https://themeisle.com"
13
- }
14
- ],
15
- "autoload": {
16
- "files": [
17
- "load.php"
18
- ]
19
- },
20
- "support": {
21
- "issues": "https://github.com/Codeinwp/full-width-page-templates/issues"
22
- }
23
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/full-width-page-templates/phpunit.xml DELETED
@@ -1,14 +0,0 @@
1
- <phpunit
2
- bootstrap="tests/bootstrap.php"
3
- backupGlobals="false"
4
- colors="true"
5
- convertErrorsToExceptions="true"
6
- convertNoticesToExceptions="true"
7
- convertWarningsToExceptions="true"
8
- >
9
- <testsuites>
10
- <testsuite>
11
- <directory prefix="test-" suffix=".php">./tests/</directory>
12
- </testsuite>
13
- </testsuites>
14
- </phpunit>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/full-width-page-templates/tests/bootstrap.php DELETED
@@ -1,50 +0,0 @@
1
- <?php
2
- /**
3
- * PHPUnit bootstrap file
4
- *
5
- * @package ThemeIsle\FullWidthTemplates
6
- */
7
-
8
- /**
9
- * change PLUGIN_FILE env in phpunit.xml
10
- */
11
- define( 'PLUGIN_FILE', getenv( 'PLUGIN_FILE' ) );
12
- define( 'PLUGIN_FOLDER', basename( dirname( __DIR__ ) ) );
13
- define( 'PLUGIN_PATH', PLUGIN_FOLDER . '/' . PLUGIN_FILE );
14
-
15
- // Activates this plugin in WordPress so it can be tested.
16
- $GLOBALS['wp_tests_options'] = [
17
- 'active_plugins' => [ PLUGIN_PATH ],
18
- 'template' => 'twentysixteen',
19
- 'stylesheet' => 'twentysixteen',
20
- ];
21
-
22
- // Determine the tests directory (from a WP dev checkout).
23
- // Try the WP_TESTS_DIR environment variable first.
24
- $_tests_dir = getenv( 'WP_TESTS_DIR' );
25
-
26
- // See if we're installed inside an existing WP dev instance.
27
- if ( ! $_tests_dir ) {
28
- $_try_tests_dir = dirname( __FILE__ ) . '/../../../../../tests/phpunit';
29
- if ( file_exists( $_try_tests_dir . '/includes/functions.php' ) ) {
30
- $_tests_dir = $_try_tests_dir;
31
- }
32
- }
33
- // Fallback.
34
- if ( ! $_tests_dir ) {
35
- $_tests_dir = '/tmp/wordpress-tests-lib';
36
- }
37
-
38
- // Give access to tests_add_filter() function.
39
- require_once $_tests_dir . '/includes/functions.php';
40
-
41
- /**
42
- * Manually load the plugin being tested.
43
- */
44
- function _manually_load_plugin() {
45
- require dirname( dirname( __FILE__ ) ) . '/load.php';
46
- }
47
- tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
48
-
49
- // Start up the WP testing environment.
50
- require $_tests_dir . '/includes/bootstrap.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/full-width-page-templates/tests/test-basics.php DELETED
@@ -1,35 +0,0 @@
1
- <?php
2
- /**
3
- * Basic Tests
4
- *
5
- * @package ThemeIsle\ContentForms
6
- */
7
-
8
- /**
9
- * Test functions in register.php
10
- */
11
- class Plugin_Test extends WP_UnitTestCase {
12
-
13
- public function setUp() {
14
- parent::setUp();
15
- wp_set_current_user( $this->factory->user->create( [ 'role' => 'administrator' ] ) );
16
-
17
- do_action( 'init' );
18
- do_action( 'plugins_loaded' );
19
- }
20
-
21
- /**
22
- * Tests test_library_availability().
23
- *
24
- * @covers FullWidthTemplates::instance();
25
- */
26
- function test_library_availability() {
27
- $this->assertTrue( class_exists( '\ThemeIsle\FullWidthTemplates') );
28
- }
29
-
30
- function test_version() {
31
- $composer_version = json_decode( file_get_contents( dirname( dirname( __FILE__ ) ) . '/composer.json' ) );
32
-
33
- $this->assertTrue( $composer_version->version === \ThemeIsle\FullWidthTemplates::$version );
34
- }
35
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/templates-directory/composer.json DELETED
@@ -1,28 +0,0 @@
1
- {
2
- "name": "codeinwp/templates-directory",
3
- "description": "A WordPress library to manage page templates.",
4
- "type": "library",
5
- "version": "1.0.9",
6
- "license": "GPL-2.0-or-later",
7
- "homepage": "https://github.com/Codeinwp/templates-directory",
8
- "authors": [
9
- {
10
- "name": "ThemeIsle team",
11
- "email": "friends@themeisle.com",
12
- "homepage": "https://themeisle.com"
13
- }
14
- ],
15
- "autoload": {
16
- "files": [
17
- "load.php"
18
- ]
19
- },
20
- "require": {
21
- "codeinwp/full-width-page-templates": "master"
22
- },
23
- "support": {
24
- "issues": "https://github.com/Codeinwp/templates-directory/issues"
25
- },
26
- "minimum-stability": "dev",
27
- "prefer-stable": true
28
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/themeisle-content-forms/assets/content-forms.css CHANGED
@@ -11,6 +11,7 @@ input, textarea {
11
  fieldset {
12
  border: none;
13
  margin: 0;
 
14
  }
15
  .content-form-loading {
16
  opacity: .5;
11
  fieldset {
12
  border: none;
13
  margin: 0;
14
+ flex-wrap: wrap;
15
  }
16
  .content-form-loading {
17
  opacity: .5;
vendor/codeinwp/themeisle-content-forms/assets/content-forms.js CHANGED
@@ -68,7 +68,7 @@ and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
68
  */
69
  var addContentFormNotice = function ( notice, type, $form ) {
70
  var noticeStatus = '',
71
- $currentNotice = $form.children( '.content-form-notice' );
72
 
73
  if ( 'success' === type ) {
74
  noticeStatus = 'content-form-success';
68
  */
69
  var addContentFormNotice = function ( notice, type, $form ) {
70
  var noticeStatus = '',
71
+ $currentNotice = $form.find( '.content-form-notice' );
72
 
73
  if ( 'success' === type ) {
74
  noticeStatus = 'content-form-success';
vendor/codeinwp/themeisle-content-forms/class-themeisle-content-forms-contact.php CHANGED
@@ -102,30 +102,33 @@ class ContactForm extends Base {
102
  * @return mixed
103
  */
104
  public function rest_submit_form( $return, $data, $widget_id, $post_id, $builder ) {
105
-
106
- if ( empty( $data['email'] ) || ! is_email( $data['email'] ) ) {
107
- $return['msg'] = esc_html__( 'Invalid email.', 'elementor-addon-widgets' );
108
-
109
- return $return;
110
- }
111
-
112
- $from = $data['email'];
113
-
114
- if ( empty( $data['name'] ) ) {
115
- $return['msg'] = esc_html__( 'Missing name.', 'elementor-addon-widgets' );
116
-
117
- return $return;
118
- }
119
-
120
- $name = $data['name'];
121
-
122
- if ( empty( $data['message'] ) ) {
123
- $return['msg'] = esc_html__( 'Missing message.', 'elementor-addon-widgets' );
124
-
125
- return $return;
126
  }
 
 
 
 
127
 
128
- $msg = $data['message'];
 
129
 
130
  // prepare settings for submit
131
  $settings = $this->get_widget_settings( $widget_id, $post_id, $builder );
@@ -142,7 +145,7 @@ class ContactForm extends Base {
142
  $return['success'] = true;
143
  $return['msg'] = $this->notices['success'];
144
  } else {
145
- $return['msg'] = esc_html__( 'Ops! I cannot send this email!', 'elementor-addon-widgets' );
146
  }
147
 
148
  return $return;
@@ -163,14 +166,16 @@ class ContactForm extends Base {
163
  $success = false;
164
 
165
  $name = sanitize_text_field( $name );
166
- $subject = 'Website inquiry from ' . $name;
167
  $mailto = sanitize_email( $mailto );
168
  $mailfrom = sanitize_email( $mailfrom );
169
 
170
  $headers = array();
171
  // use admin email assuming the Server is allowed to send as admin email
172
  $headers[] = 'From: Admin <' . get_option( 'admin_email' ) . '>';
173
- $headers[] = 'Reply-To: ' . $name . ' <' . $mailfrom . '>';
 
 
174
  $headers[] = 'Content-Type: text/html; charset=UTF-8';
175
 
176
  $body = $this->prepare_body( $body, $extra_data );
@@ -205,7 +210,7 @@ class ContactForm extends Base {
205
  <!-- view port meta tag -->
206
  <meta name="viewport" content="width=device-width, initial-scale=1">
207
  <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
208
- <title><?php echo esc_html__( 'Mail From: ', 'elementor-addon-widgets' ) . esc_html( $data['name'] ); ?></title>
209
  </head>
210
  <body>
211
  <table>
@@ -235,7 +240,7 @@ class ContactForm extends Base {
235
  <tr>
236
  <td>
237
  <hr/>
238
- <?php esc_html_e( 'You recieved this email because your email address is set in the content form settings on ', 'elementor-addon-widgets' ) ?>
239
  <a href="<?php echo esc_url( get_site_url() ); ?>"><?php bloginfo( 'name' ); ?></a>
240
  </td>
241
  </tr>
102
  * @return mixed
103
  */
104
  public function rest_submit_form( $return, $data, $widget_id, $post_id, $builder ) {
105
+ $settings = $this->get_widget_settings( $widget_id, $post_id, $builder );
106
+ $required = array();
107
+ foreach( $settings['form_fields'] as $field ) {
108
+ if ( 'required' === $field['requirement'] ) {
109
+ $key = $field['key'];
110
+ if ( empty( $key ) ) {
111
+ $key = $field['label'];
112
+ }
113
+ $required[] = $key;
114
+ if ( empty( $data[ $key ] ) ) {
115
+ $return['msg'] = esc_html( sprintf( 'Missing %s', $field['label']), 'textdomain' );
116
+ return $return;
117
+ } else {
118
+ if ( $key === 'email' && ! is_email( $data['email'] ) ) {
119
+ $return['msg'] = esc_html__( 'Invalid email.', 'elementor-addon-widgets' );
120
+ return $return;
121
+ }
122
+ }
123
+ }
 
 
124
  }
125
+
126
+ // Empty email does not make much sense!
127
+ $from = isset( $data['email'] ) ? $data['email'] : null;
128
+ $name = isset( $data['name'] ) ? $data['name'] : null;
129
 
130
+ // Empty message does not make much sense!
131
+ $msg = isset( $data['message'] ) ? $data['message'] : null;
132
 
133
  // prepare settings for submit
134
  $settings = $this->get_widget_settings( $widget_id, $post_id, $builder );
145
  $return['success'] = true;
146
  $return['msg'] = $this->notices['success'];
147
  } else {
148
+ $return['msg'] = esc_html__( 'Oops! I cannot send this email!', 'elementor-addon-widgets' );
149
  }
150
 
151
  return $return;
166
  $success = false;
167
 
168
  $name = sanitize_text_field( $name );
169
+ $subject = 'Website inquiry from ' . ( ! empty( $name ) ? $name : 'N/A' );
170
  $mailto = sanitize_email( $mailto );
171
  $mailfrom = sanitize_email( $mailfrom );
172
 
173
  $headers = array();
174
  // use admin email assuming the Server is allowed to send as admin email
175
  $headers[] = 'From: Admin <' . get_option( 'admin_email' ) . '>';
176
+ if ( ! empty( $mailfrom ) ) {
177
+ $headers[] = 'Reply-To: ' . $name . ' <' . $mailfrom . '>';
178
+ }
179
  $headers[] = 'Content-Type: text/html; charset=UTF-8';
180
 
181
  $body = $this->prepare_body( $body, $extra_data );
210
  <!-- view port meta tag -->
211
  <meta name="viewport" content="width=device-width, initial-scale=1">
212
  <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
213
+ <title><?php echo esc_html__( 'Mail From: ', 'elementor-addon-widgets' ) . isset( $data['name'] ) ? esc_html( $data['name'] ) : 'N/A'; ?></title>
214
  </head>
215
  <body>
216
  <table>
240
  <tr>
241
  <td>
242
  <hr/>
243
+ <?php esc_html_e( 'You received this email because your email address is set in the content form settings on ', 'elementor-addon-widgets' ) ?>
244
  <a href="<?php echo esc_url( get_site_url() ); ?>"><?php bloginfo( 'name' ); ?></a>
245
  </td>
246
  </tr>
vendor/codeinwp/themeisle-content-forms/class-themeisle-content-forms-newsletter.php CHANGED
@@ -163,14 +163,16 @@ class NewsletterForm extends Base {
163
  $url = 'https://' . substr( $api_key, strpos( $api_key, '-' ) + 1 ) . '.api.mailchimp.com/3.0/lists/' . $list_id . '/members/' . md5( strtolower( $email ) );
164
 
165
  $response = wp_remote_post( $url, $args );
 
166
 
167
  if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
168
- return $response;
 
 
169
  }
170
 
171
- $body = json_decode( wp_remote_retrieve_body( $response ), true );
172
 
173
- if ( $body->status == $status ) {
174
  $result['success'] = true;
175
  $result['msg'] = $this->notices['success'];
176
  } else {
@@ -184,6 +186,7 @@ class NewsletterForm extends Base {
184
 
185
  $url = 'https://api.sendinblue.com/v3/contacts';
186
 
 
187
  $args = array(
188
  'method' => 'POST',
189
  'headers' => array(
@@ -200,22 +203,19 @@ class NewsletterForm extends Base {
200
 
201
  $response = wp_remote_post( $url, $args );
202
 
203
- if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
204
-
205
- $body = json_decode( wp_remote_retrieve_body( $response ), true );
206
-
207
- if ( ! empty( $body['message'] ) ) {
208
- $result['msg'] = $body['message'];
209
- } else {
210
- $result['msg'] = $response;
211
- }
212
-
213
  return $result;
214
  }
215
 
216
- $result['success'] = true;
217
- $result['msg'] = $this->notices['success'];
 
 
 
218
 
 
 
219
  return $result;
220
  break;
221
 
163
  $url = 'https://' . substr( $api_key, strpos( $api_key, '-' ) + 1 ) . '.api.mailchimp.com/3.0/lists/' . $list_id . '/members/' . md5( strtolower( $email ) );
164
 
165
  $response = wp_remote_post( $url, $args );
166
+ $body = json_decode( wp_remote_retrieve_body( $response ), true );
167
 
168
  if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
169
+ $result['success'] = false;
170
+ $result['msg'] = $body['detail'];
171
+ return $result;
172
  }
173
 
 
174
 
175
+ if ( $body['status'] == $status ) {
176
  $result['success'] = true;
177
  $result['msg'] = $this->notices['success'];
178
  } else {
186
 
187
  $url = 'https://api.sendinblue.com/v3/contacts';
188
 
189
+ // https://developers.sendinblue.com/reference#createcontact
190
  $args = array(
191
  'method' => 'POST',
192
  'headers' => array(
203
 
204
  $response = wp_remote_post( $url, $args );
205
 
206
+ if ( is_wp_error( $response ) ) {
207
+ $result['msg'] = $this->notices['error'];
 
 
 
 
 
 
 
 
208
  return $result;
209
  }
210
 
211
+ if ( 400 != wp_remote_retrieve_response_code( $response ) ) {
212
+ $result['success'] = true;
213
+ $result['msg'] = $this->notices['success'];
214
+ return $result;
215
+ }
216
 
217
+ $body = json_decode( wp_remote_retrieve_body( $response ), true );
218
+ $result['msg'] = $body['message'];
219
  return $result;
220
  break;
221
 
vendor/codeinwp/themeisle-content-forms/composer.json DELETED
@@ -1,25 +0,0 @@
1
- {
2
- "name": "codeinwp/themeisle-content-forms",
3
- "version": "1.2.0",
4
- "description": "ThemeIsle Content Forms ",
5
- "keywords": [
6
- "wordpress"
7
- ],
8
- "homepage": "https://github.com/Codeinwp/themeisle-content-forms",
9
- "license": "GPL-2.0-or-later",
10
- "authors": [
11
- {
12
- "name": "ThemeIsle team",
13
- "email": "friends@themeisle.com",
14
- "homepage": "https://themeisle.com"
15
- }
16
- ],
17
- "autoload": {
18
- "files": [
19
- "load.php"
20
- ]
21
- },
22
- "support": {
23
- "issues": "https://github.com/Codeinwp/themeisle-content-forms/issues"
24
- }
25
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/themeisle-content-forms/phpunit.xml DELETED
@@ -1,14 +0,0 @@
1
- <phpunit
2
- bootstrap="tests/bootstrap.php"
3
- backupGlobals="false"
4
- colors="true"
5
- convertErrorsToExceptions="true"
6
- convertNoticesToExceptions="true"
7
- convertWarningsToExceptions="true"
8
- >
9
- <testsuites>
10
- <testsuite>
11
- <directory prefix="test-" suffix=".php">./tests/</directory>
12
- </testsuite>
13
- </testsuites>
14
- </phpunit>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/themeisle-content-forms/tests/bootstrap.php DELETED
@@ -1,50 +0,0 @@
1
- <?php
2
- /**
3
- * PHPUnit bootstrap file
4
- *
5
- * @package ThemeIsle\ContentForms
6
- */
7
-
8
- /**
9
- * change PLUGIN_FILE env in phpunit.xml
10
- */
11
- define( 'PLUGIN_FILE', getenv( 'PLUGIN_FILE' ) );
12
- define( 'PLUGIN_FOLDER', basename( dirname( __DIR__ ) ) );
13
- define( 'PLUGIN_PATH', PLUGIN_FOLDER . '/' . PLUGIN_FILE );
14
-
15
- // Activates this plugin in WordPress so it can be tested.
16
- $GLOBALS['wp_tests_options'] = [
17
- 'active_plugins' => [ PLUGIN_PATH ],
18
- 'template' => 'twentysixteen',
19
- 'stylesheet' => 'twentysixteen',
20
- ];
21
-
22
- // Determine the tests directory (from a WP dev checkout).
23
- // Try the WP_TESTS_DIR environment variable first.
24
- $_tests_dir = getenv( 'WP_TESTS_DIR' );
25
-
26
- // See if we're installed inside an existing WP dev instance.
27
- if ( ! $_tests_dir ) {
28
- $_try_tests_dir = dirname( __FILE__ ) . '/../../../../../tests/phpunit';
29
- if ( file_exists( $_try_tests_dir . '/includes/functions.php' ) ) {
30
- $_tests_dir = $_try_tests_dir;
31
- }
32
- }
33
- // Fallback.
34
- if ( ! $_tests_dir ) {
35
- $_tests_dir = '/tmp/wordpress-tests-lib';
36
- }
37
-
38
- // Give access to tests_add_filter() function.
39
- require_once $_tests_dir . '/includes/functions.php';
40
-
41
- /**
42
- * Manually load the plugin being tested.
43
- */
44
- function _manually_load_plugin() {
45
- require dirname( dirname( __FILE__ ) ) . '/load.php';
46
- }
47
- tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
48
-
49
- // Start up the WP testing environment.
50
- require $_tests_dir . '/includes/bootstrap.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/themeisle-content-forms/tests/test-basics.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
- /**
3
- * Basic Tests
4
- *
5
- * @package ThemeIsle\ContentForms
6
- */
7
-
8
- /**
9
- * Test functions in register.php
10
- */
11
- class Plugin_Test extends WP_UnitTestCase {
12
-
13
- public function setUp() {
14
- parent::setUp();
15
- wp_set_current_user( $this->factory->user->create( [ 'role' => 'administrator' ] ) );
16
-
17
- do_action( 'init' );
18
- do_action( 'plugins_loaded' );
19
- }
20
-
21
- /**
22
- * Tests test_library_availability().
23
- *
24
- * @covers test_library_availability
25
- */
26
- function test_library_availability() {
27
- $this->assertTrue( class_exists( '\ThemeIsle\ContentForms\ContactForm') );
28
- $this->assertTrue( class_exists( '\ThemeIsle\ContentForms\NewsletterForm') );
29
- $this->assertTrue( class_exists( '\ThemeIsle\ContentForms\RegistrationForm') );
30
- }
31
-
32
-
33
- /**
34
- * Tests if the default style can be disalbed.
35
- *
36
- * @covers themeisle_content_forms_register_public_assets
37
- */
38
- function test_posibility_to_disable_default_style() {
39
- // the content-forms scripts should not be registered before the below function is called.
40
- $this->assertFalse( wp_style_is( 'content-forms', 'registered' ) );
41
-
42
- add_filter( 'themeisle_content_forms_register_default_style', '__return_false' );
43
-
44
- themeisle_content_forms_register_public_assets();
45
-
46
- $this->assertFalse( wp_style_is( 'content-forms', 'registered' ) );
47
- }
48
-
49
- /**
50
- * Tests form default styles availability.
51
- *
52
- * @covers themeisle_content_forms_register_public_assets
53
- */
54
- function test_style_availability() {
55
- // the content-forms scripts should not be registered before the below function is called
56
- $this->assertFalse( wp_style_is( 'content-forms', 'registered' ) );
57
-
58
- themeisle_content_forms_register_public_assets();
59
-
60
- $this->assertTrue( wp_style_is( 'content-forms', 'registered' ) );
61
- }
62
-
63
- /**
64
- * Tests scripts availability.
65
- *
66
- * @covers themeisle_content_forms_register_public_assets
67
- */
68
- function test_script_availability() {
69
-
70
- // check if the function which should load assets exists
71
- $this->assertTrue( function_exists( 'themeisle_content_forms_register_public_assets' ) );
72
-
73
- // the content-forms scripts should not be enqueued before the aboce function is called
74
- $this->assertFalse( wp_script_is( 'content-forms' ) );
75
-
76
- // by default, front-end scripts are not enqueued globally. but we can do it for the sake of a test
77
- add_filter( 'themeisle_content_forms_force_js_enqueue', '__return_true' );
78
-
79
- themeisle_content_forms_register_public_assets();
80
-
81
- $this->assertTrue( wp_script_is( 'content-forms' ) );
82
- }
83
-
84
-
85
-
86
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/themeisle-content-forms/tests/test-contact-form.php DELETED
@@ -1,113 +0,0 @@
1
- <?php
2
- /**
3
- * Contact Form Tests
4
- *
5
- * @package ThemeIsle\ContentForms
6
- */
7
-
8
- /**
9
- * Test functions in register.php
10
- */
11
- class ContactFormTest extends WP_UnitTestCase {
12
-
13
- public $form = null;
14
-
15
- public function setUp() {
16
- parent::setUp();
17
- wp_set_current_user( $this->factory->user->create( [ 'role' => 'administrator' ] ) );
18
-
19
- $this->form = \ThemeIsle\ContentForms\ContactForm::instance();
20
- }
21
-
22
- /**
23
- * Each form should have defined a type.
24
- */
25
- function test_form_type() {
26
- $this->assertEquals( 'contact', $this->form->get_type() );
27
- }
28
-
29
- /**
30
- * Make sure that the form has a config defined.
31
- */
32
- function test_if_config_exists() {
33
- $this->assertTrue( method_exists( $this->form, 'make_form_config' ) );
34
- }
35
-
36
- /**
37
- * The `rest_submit_form` form is required.
38
- */
39
- function test_if_rest_callback_exists() {
40
- $this->assertTrue( method_exists( $this->form, 'rest_submit_form' ) );
41
- }
42
-
43
- /**
44
- * Every config must have a these keys
45
- */
46
- function test_if_config_is_valid() {
47
- $config = $this->form->get_config();
48
-
49
- $this->assertArrayHasKey( 'id', $config );
50
- $this->assertArrayHasKey( 'title', $config );
51
- $this->assertArrayHasKey( 'icon', $config );
52
- $this->assertArrayHasKey( 'fields', $config );
53
- $this->assertArrayHasKey( 'controls', $config );
54
- }
55
-
56
-
57
- /**
58
- * If a request to `rest_submit_form` lacks data the method should warn about email.
59
- */
60
- function test_an_empty_submit() {
61
-
62
- $return = $this->form->rest_submit_form(
63
- array(),
64
- array(),
65
- 1,
66
- 1,
67
- 'builder'
68
- );
69
-
70
- $this->assertEquals( $return, array(
71
- 'msg' => 'Invalid email.'
72
- ) );
73
- }
74
-
75
- /**
76
- * If a request to `rest_submit_form` lacks the name from data should trigger a warning
77
- */
78
- function test_name_warning() {
79
-
80
- $return = $this->form->rest_submit_form(
81
- array(),
82
- array( 'email' => 'admin@admin.com' ),
83
- 1,
84
- 1,
85
- 'builder'
86
- );
87
-
88
- $this->assertEquals( $return, array(
89
- 'msg' => 'Missing name.'
90
- ) );
91
- }
92
-
93
- /**
94
- * If a request to `rest_submit_form` lacks the message from data should trigger a warning.
95
- */
96
- function test_message_warning() {
97
-
98
- $return = $this->form->rest_submit_form(
99
- array(),
100
- array(
101
- 'email' => 'admin@admin.com',
102
- 'name' => 'My name',
103
- ),
104
- 1,
105
- 1,
106
- 'builder'
107
- );
108
-
109
- $this->assertEquals( $return, array(
110
- 'msg' => 'Missing message.'
111
- ) );
112
- }
113
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/themeisle-content-forms/tests/test-newsletter-form.php DELETED
@@ -1,73 +0,0 @@
1
- <?php
2
- /**
3
- * Contact Form Tests
4
- *
5
- * @package ThemeIsle\ContentForms
6
- */
7
-
8
- /**
9
- * Test functions in register.php
10
- */
11
- class NewsletterFormTest extends WP_UnitTestCase {
12
-
13
- public $form = null;
14
-
15
- public function setUp() {
16
- parent::setUp();
17
- wp_set_current_user( $this->factory->user->create( [ 'role' => 'administrator' ] ) );
18
-
19
- $this->form = \ThemeIsle\ContentForms\NewsletterForm::instance();
20
- }
21
-
22
- /**
23
- * Each form should have defined a type.
24
- */
25
- function test_form_type() {
26
- $this->assertEquals( 'newsletter', $this->form->get_type() );
27
- }
28
-
29
- /**
30
- * Make sure that the form has a config defined.
31
- */
32
- function test_if_config_exists() {
33
- $this->assertTrue( method_exists( $this->form, 'make_form_config' ) );
34
- }
35
-
36
- /**
37
- * The `rest_submit_form` form is required.
38
- */
39
- function test_if_rest_callback_exists() {
40
- $this->assertTrue( method_exists( $this->form, 'rest_submit_form' ) );
41
- }
42
-
43
- /**
44
- * Every config must have a these keys
45
- */
46
- function test_if_config_is_valid() {
47
- $config = $this->form->get_config();
48
-
49
- $this->assertArrayHasKey( 'id', $config );
50
- $this->assertArrayHasKey( 'title', $config );
51
- $this->assertArrayHasKey( 'icon', $config );
52
- $this->assertArrayHasKey( 'fields', $config );
53
- $this->assertArrayHasKey( 'controls', $config );
54
- }
55
-
56
- /**
57
- * If a request to `rest_submit_form` lacks data the method should warn about email.
58
- */
59
- function test_an_empty_submit() {
60
-
61
- $return = $this->form->rest_submit_form(
62
- array(),
63
- array(),
64
- 1,
65
- 1,
66
- 'builder'
67
- );
68
-
69
- $this->assertEquals( $return, array(
70
- 'msg' => 'Invalid email.'
71
- ) );
72
- }
73
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/themeisle-content-forms/tests/test-registration-form.php DELETED
@@ -1,139 +0,0 @@
1
- <?php
2
- /**
3
- * Contact Form Tests
4
- *
5
- * @package ThemeIsle\ContentForms
6
- */
7
-
8
- /**
9
- * Test functions in register.php
10
- */
11
- class RegistrationFormTest extends WP_UnitTestCase {
12
-
13
- public $form = null;
14
-
15
- public function setUp() {
16
- parent::setUp();
17
- wp_set_current_user( $this->factory->user->create( [ 'role' => 'administrator' ] ) );
18
-
19
- $this->form = \ThemeIsle\ContentForms\RegistrationForm::instance();
20
- }
21
-
22
- /**
23
- * Each form should have defined a type.
24
- */
25
- function test_form_type() {
26
- $this->assertEquals( 'registration', $this->form->get_type() );
27
- }
28
-
29
- /**
30
- * Make sure that the form has a config defined.
31
- */
32
- function test_if_config_exists() {
33
- $this->assertTrue( method_exists( $this->form, 'make_form_config' ) );
34
- }
35
-
36
- /**
37
- * The `rest_submit_form` form is required.
38
- */
39
- function test_if_rest_callback_exists() {
40
- $this->assertTrue( method_exists( $this->form, 'rest_submit_form' ) );
41
- }
42
-
43
- /**
44
- * Every config must have a these keys
45
- */
46
- function test_if_config_is_valid() {
47
- $config = $this->form->get_config();
48
-
49
- $this->assertArrayHasKey( 'id', $config );
50
- $this->assertArrayHasKey( 'title', $config );
51
- $this->assertArrayHasKey( 'icon', $config );
52
- $this->assertArrayHasKey( 'fields', $config );
53
- $this->assertArrayHasKey( 'controls', $config );
54
- }
55
-
56
- /**
57
- * If a request to `rest_submit_form` lacks data the method should warn about email.
58
- */
59
- function test_an_empty_submit() {
60
-
61
- $return = $this->form->rest_submit_form(
62
- array(),
63
- array(),
64
- 1,
65
- 1,
66
- 'builder'
67
- );
68
-
69
- $this->assertEquals( $return, array(
70
- 'msg' => 'Invalid email.'
71
- ) );
72
- }
73
-
74
- /**
75
- * Test the case when the username is not present in the request
76
- */
77
- function test_username_missing() {
78
-
79
- update_option( 'users_can_register', 1 );
80
-
81
- $return = $this->form->rest_submit_form(
82
- array(),
83
- array( 'email' => 'admin@admin.com' ),
84
- 1,
85
- 1,
86
- 'builder'
87
- );
88
-
89
- // if the username is not serverd, the email should be used instead
90
- $this->assertEquals( $return, array(
91
- 'success' => true,
92
- 'msg' => 'Welcome, admin@admin.com'
93
- ) );
94
- }
95
-
96
- /**
97
- * If a request to `rest_submit_form` lacks the username from data should trigger a warning
98
- */
99
- function test_disabled_user_registration() {
100
- $return = $this->form->rest_submit_form(
101
- array(),
102
- array(
103
- 'username' => 'admin2',
104
- 'email' => 'admin@admin.com',
105
- ),
106
- 1,
107
- 1,
108
- 'builder'
109
- );
110
-
111
- $this->assertEquals( $return, array(
112
- 'msg' => 'This website does not allow registrations at this moment!'
113
- ) );
114
- }
115
-
116
- /**
117
- * If a request to `rest_submit_form` lacks the username from data should trigger a warning
118
- */
119
- function test_user_creation() {
120
- // by default, this option is false; but we need it to test the registration
121
- update_option( 'users_can_register', 1 );
122
-
123
- $return = $this->form->rest_submit_form(
124
- array(),
125
- array(
126
- 'username' => 'admin2',
127
- 'email' => 'admin@admin.com',
128
- ),
129
- 1,
130
- 1,
131
- 'builder'
132
- );
133
-
134
- $this->assertEquals( $return, array(
135
- 'success' => true,
136
- 'msg' => 'Welcome, admin2'
137
- ) );
138
- }
139
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codeinwp/themeisle-content-forms/tests/test-server.php DELETED
@@ -1,62 +0,0 @@
1
- <?php
2
- /**
3
- * Basic Tests
4
- *
5
- * @package ThemeIsle\ContentForms
6
- */
7
-
8
- /**
9
- * Test functions in register.php
10
- */
11
- class RestServerTest extends WP_UnitTestCase {
12
-
13
- public $server = null;
14
- private $nonce = null;
15
-
16
- public function setUp() {
17
- parent::setUp();
18
- wp_set_current_user( $this->factory->user->create( [ 'role' => 'administrator' ] ) );
19
-
20
- $this->server = \Themeisle\ContentForms\RestServer::instance();
21
-
22
- $this->nonce = wp_create_nonce( 'content-form-1' );
23
-
24
- do_action( 'rest_api_init' );
25
- do_action( 'init' );
26
- do_action( 'plugins_loaded' );
27
- }
28
-
29
- public function test_form_submission() {
30
-
31
- // @TODO try to mock a request
32
- $request = new WP_REST_Request( 'POST', '/content-forms/v1/check', array(
33
- 'args' => array( 'nonce' => $this->nonce ),
34
- 'form_id' => '1',
35
- 'post_id' => '1'
36
- ) );
37
-
38
- $this->assertTrue( method_exists( $this->server, 'submit_form' ) );
39
- // @TODO try to actually test the method call
40
- }
41
-
42
- /**
43
- * Test the right type of class instance
44
- */
45
- public function test_getInstance() {
46
- $this->assertInstanceOf( '\Themeisle\ContentForms\RestServer', \Themeisle\ContentForms\RestServer::$instance );
47
- }
48
-
49
- /**
50
- * @expectedIncorrectUsage __clone
51
- */
52
- public function test_Clone() {
53
- $obj_cloned = clone \Themeisle\ContentForms\RestServer::$instance;
54
- }
55
-
56
- /**
57
- * @expectedIncorrectUsage __wakeup
58
- */
59
- public function test_Wakeup() {
60
- unserialize( serialize( \Themeisle\ContentForms\RestServer::$instance ) );
61
- }
62
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit1949c25865d8e9f266b9f04c54d29d81
6
  {
7
  private static $loader;
8
 
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit1949c25865d8e9f266b9f04c54d29d81
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit1949c25865d8e9f266b9f04c54d29d81', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit1949c25865d8e9f266b9f04c54d29d81', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
@@ -42,14 +42,14 @@ class ComposerAutoloaderInit1949c25865d8e9f266b9f04c54d29d81
42
 
43
  $includeFiles = require __DIR__ . '/autoload_files.php';
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
- composerRequire1949c25865d8e9f266b9f04c54d29d81($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
- function composerRequire1949c25865d8e9f266b9f04c54d29d81($fileIdentifier, $file)
53
  {
54
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
55
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitd247449b2aa8f76a384c8256504c9931
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInitd247449b2aa8f76a384c8256504c9931', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitd247449b2aa8f76a384c8256504c9931', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
42
 
43
  $includeFiles = require __DIR__ . '/autoload_files.php';
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
+ composerRequired247449b2aa8f76a384c8256504c9931($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
+ function composerRequired247449b2aa8f76a384c8256504c9931($fileIdentifier, $file)
53
  {
54
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
55
  require $file;
vendor/composer/installed.json CHANGED
@@ -42,15 +42,15 @@
42
  "source": {
43
  "type": "git",
44
  "url": "https://github.com/Codeinwp/themeisle-content-forms.git",
45
- "reference": "6cf6eb081bc89e99441075b994ed345dbc8670b4"
46
  },
47
  "dist": {
48
  "type": "zip",
49
- "url": "https://api.github.com/repos/Codeinwp/themeisle-content-forms/zipball/6cf6eb081bc89e99441075b994ed345dbc8670b4",
50
- "reference": "6cf6eb081bc89e99441075b994ed345dbc8670b4",
51
  "shasum": ""
52
  },
53
- "time": "2019-01-10 13:04:46",
54
  "type": "library",
55
  "installation-source": "source",
56
  "autoload": {
@@ -82,15 +82,15 @@
82
  "source": {
83
  "type": "git",
84
  "url": "https://github.com/Codeinwp/full-width-page-templates.git",
85
- "reference": "770990cf96bd9cb6b8c846b1c9bff16450e2dff9"
86
  },
87
  "dist": {
88
  "type": "zip",
89
- "url": "https://api.github.com/repos/Codeinwp/full-width-page-templates/zipball/770990cf96bd9cb6b8c846b1c9bff16450e2dff9",
90
- "reference": "770990cf96bd9cb6b8c846b1c9bff16450e2dff9",
91
  "shasum": ""
92
  },
93
- "time": "2018-03-02 08:33:03",
94
  "type": "library",
95
  "installation-source": "source",
96
  "autoload": {
42
  "source": {
43
  "type": "git",
44
  "url": "https://github.com/Codeinwp/themeisle-content-forms.git",
45
+ "reference": "956f286a24ce8375e60d972fea7afb6b2be29428"
46
  },
47
  "dist": {
48
  "type": "zip",
49
+ "url": "https://api.github.com/repos/Codeinwp/themeisle-content-forms/zipball/956f286a24ce8375e60d972fea7afb6b2be29428",
50
+ "reference": "956f286a24ce8375e60d972fea7afb6b2be29428",
51
  "shasum": ""
52
  },
53
+ "time": "2019-04-17 09:29:49",
54
  "type": "library",
55
  "installation-source": "source",
56
  "autoload": {
82
  "source": {
83
  "type": "git",
84
  "url": "https://github.com/Codeinwp/full-width-page-templates.git",
85
+ "reference": "ac15bbb1295d39baf28978c7d9c04fed21ea3429"
86
  },
87
  "dist": {
88
  "type": "zip",
89
+ "url": "https://api.github.com/repos/Codeinwp/full-width-page-templates/zipball/ac15bbb1295d39baf28978c7d9c04fed21ea3429",
90
+ "reference": "ac15bbb1295d39baf28978c7d9c04fed21ea3429",
91
  "shasum": ""
92
  },
93
+ "time": "2019-04-02 11:34:00",
94
  "type": "library",
95
  "installation-source": "source",
96
  "autoload": {