10% wp-wonderform

Code Review | WP WonderForm

WordPress plugin WP WonderForm scored 10% from 54 tests.

About plugin

  • Plugin page: wp-wonderform
  • Plugin version: 1.3.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.7.4
  • WordPress version: 5.8.1
  • First release: May 9, 2017
  • Latest release: Jun 18, 2017
  • Number of updates: 58
  • Update frequency: every 0.7 days
  • Top authors: lybaba (96.55%)wonderstudio (5.17%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 1,137 total downloads


Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
These installer errors require your attention
  • Install procedure had errors
    • > Warning in wp-content/plugins/wp-wonderform/includes/extern/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php+2636
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

Server metrics [RAM: ▲0.31MB] [CPU: ▼173.90ms] Passed 4 tests

Analyzing server-side resources used by WP WonderForm
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.94 ▲1.2219.01 ▼1.69
Dashboard /wp-admin3.96 ▲0.9116.61 ▼23.68
Posts /wp-admin/edit.php3.96 ▲0.8515.65 ▼26.56
Add New Post /wp-admin/post-new.php3.96 ▼1.4713.79 ▼629.88
Media Library /wp-admin/upload.php3.96 ▲0.9614.81 ▼15.47
WonderForm Player /wp-admin/admin.php?page=wf-player3.9613.63

Server storage [IO: ▲22.16MB] [DB: ▲0.04MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 3,301 new files
Database: 15 new tables, 2 new options
New tables
New WordPress options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP WonderForm
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,698 ▲10215.81 ▼0.139.02 ▲1.0144.49 ▼4.93
Dashboard /wp-admin2,987 ▲536.06 ▲0.08137.05 ▼21.59111.27 ▼7.76
Posts /wp-admin/edit.php2,751 ▲122.70 ▼0.0070.96 ▲0.5191.00 ▲0.31
Add New Post /wp-admin/post-new.php1,508 ▼17518.88 ▼0.03356.38 ▼6.17111.81 ▲7.05
Media Library /wp-admin/upload.php1,825 ▲185.02 ▲0.01146.43 ▼4.12123.20 ▲6.47
WonderForm Player /wp-admin/admin.php?page=wf-player6801.9634.3435.60

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 50% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/wp-wonderform/includes/extern/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php+2636
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
  • The uninstall procedure has failed, leaving 2 options in the database
    • wonderform_version
    • wonderform_dir

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wf-player
    • > Warning in wp-content/plugins/wp-wonderform/includes/extern/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php+2665
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-wonderform/includes/extern/vendor/doctrine/dbal/bin/doctrine-dbal.php
    • > /wp-content/plugins/wp-wonderform/includes/extern/vendor/swiftmailer/swiftmailer/lib/swiftmailer_generate_mimes_config.php
    • > /wp-content/plugins/wp-wonderform/includes/extern/vendor/doctrine/orm/bin/doctrine.php
  • 1679× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wp-wonderform/includes/extern/vendor/symfony/debug/Tests/ExceptionHandlerTest.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\HttpKernel\\Profiler\\ProfilerStorageInterface' not found in wp-content/plugins/wp-wonderform/includes/extern/vendor/symfony/http-kernel/Profiler/RedisProfilerStorage.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Doctrine\\ORM\\Event\\LifecycleEventArgs' not found in wp-content/plugins/wp-wonderform/includes/extern/vendor/doctrine/orm/lib/Doctrine/ORM/Event/PreUpdateEventArgs.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Swift_Mime_EmbeddedFile' not found in wp-content/plugins/wp-wonderform/includes/extern/vendor/swiftmailer/swiftmailer/lib/classes/Swift/EmbeddedFile.php:16
    • > PHP Notice
      Undefined variable: metadata in wp-content/plugins/wp-wonderform/includes/extern/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/TestEntity.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wp-wonderform/includes/extern/vendor/symfony/routing/Tests/RouteCollectionTest.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Doctrine\\ORM\\Mapping\\ClassMetadataFactory' not found in wp-content/plugins/wp-wonderform/includes/extern/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/DisconnectedClassMetadataFactory.php:39
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wp-wonderform/includes/extern/vendor/symfony/http-kernel/Tests/DependencyInjection/FragmentRendererPassTest.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Doctrine\\DBAL\\Exception\\ServerException' not found in wp-content/plugins/wp-wonderform/includes/extern/vendor/doctrine/dbal/lib/Doctrine/DBAL/Exception/ConstraintViolationException.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_BaseNodeVisitor' not found in wp-content/plugins/wp-wonderform/includes/extern/vendor/symfony/twig-bridge/NodeVisitor/TranslationNodeVisitor.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test


Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Contributors: Plugin contributors field is missing
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

wp-wonderform/wonderform.php 77% from 13 tests

The main file in "WP WonderForm" v. 1.3.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-wonderform.php" instead of "wonderform.php")
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
These items require your attention
  • Do not distribute dangerous files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/wp-wonderform/includes/extern/vendor/swiftmailer/swiftmailer/tests/_samples/smime/ca.crt
      • wp-content/plugins/wp-wonderform/includes/extern/vendor/swiftmailer/swiftmailer/tests/_samples/smime/encrypt.crt
      • wp-content/plugins/wp-wonderform/includes/extern/vendor/swiftmailer/swiftmailer/tests/_samples/smime/encrypt2.crt
      • wp-content/plugins/wp-wonderform/includes/extern/vendor/swiftmailer/swiftmailer/tests/_samples/smime/intermediate.crt
      • wp-content/plugins/wp-wonderform/includes/extern/vendor/swiftmailer/swiftmailer/tests/_samples/smime/sign.crt
      • wp-content/plugins/wp-wonderform/includes/extern/vendor/swiftmailer/swiftmailer/tests/_samples/smime/sign2.crt
    • .bat - Batch File in Windows
      • wp-content/plugins/wp-wonderform/includes/extern/vendor/doctrine/orm/bin/doctrine.bat
      • wp-content/plugins/wp-wonderform/includes/extern/vendor/doctrine/orm/docs/en/make.bat
    • .exe - Executable in Windows
      • wp-content/plugins/wp-wonderform/includes/extern/vendor/symfony/console/Resources/bin/hiddeninput.exe
369,693 lines of code in 2,783 files:
LanguageFilesBlank linesComment linesLines of code
DOS Batch2171104
Bourne Shell413055
C/C++ Header2192155

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 151)
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity8.45
▷ Minimum class complexity1.00
▷ Maximum class complexity414.00
Average method complexity2.11
▷ Minimum method complexity1.00
▷ Maximum method complexity151.00
Code structure
▷ Abstract classes1065.28%
▷ Concrete classes1,90094.72%
▷ Final classes824.32%
▷ Static methods7434.79%
▷ Public methods13,00983.93%
▷ Protected methods1,55410.03%
▷ Private methods9366.04%
▷ Named functions10818.12%
▷ Anonymous functions48881.88%
▷ Global constants101.10%
▷ Class constants89798.90%
▷ Public constants897100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
15 PNG files occupy 0.18MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/public/assets/img/wf-light.png39.67KB14.83KB▼ 62.62%
includes/public/assets/img/editor/livepreview/50.png1.09KB0.29KB▼ 73.93%
includes/public/assets/img/editor/theme2.png3.38KB2.47KB▼ 27.02%
includes/public/assets/img/editor/livepreview/v-blue.png0.96KB0.10KB▼ 89.07%
includes/public/assets/img/editor/livepreview/20.png1.01KB0.17KB▼ 83.41%