78% motiforms

Code Review | Motiforms

WordPress plugin Motiforms scored78%from 54 tests.

About plugin

  • Plugin page: motiforms
  • Plugin version: 0.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.8.3
  • WordPress version: 6.3.1
  • First release: Nov 10, 2017
  • Latest release: Nov 10, 2017
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: kierzniak (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /832 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼9.13ms] Passed 4 tests

Analyzing server-side resources used by Motiforms
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.07 ▲1.09
Dashboard /wp-admin3.32 ▼0.0353.81 ▼18.50
Posts /wp-admin/edit.php3.43 ▲0.0751.21 ▲1.02
Add New Post /wp-admin/post-new.php5.90 ▲0.0187.93 ▼14.98
Media Library /wp-admin/upload.php3.24 ▲0.0138.38 ▼4.07

Server storage [IO: ▲13.62MB] [DB: ▲0.00MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 2,614 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Motiforms
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5413.16 ▼1.221.89 ▲0.1448.62 ▲4.02
Dashboard /wp-admin2,218 ▲125.99 ▲1.10102.64 ▼6.5944.53 ▼1.85
Posts /wp-admin/edit.php2,103 ▲32.01 ▼0.0141.10 ▲5.7935.63 ▼0.21
Add New Post /wp-admin/post-new.php1,540 ▲923.36 ▲0.01635.77 ▲16.0571.28 ▲15.25
Media Library /wp-admin/upload.php1,400 ▼04.26 ▼0.0099.47 ▼15.9853.52 ▲6.28

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/motiforms/vendor/symfony/framework-bundle/Resources/views/Form/form_start.html.php
  • 1230× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/motiforms/themes/motiforms/form.html.php on line 14
    • > PHP Notice
      Undefined variable: view in wp-content/plugins/motiforms/themes/motiforms/radio-widget.html.php on line 27
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\DependencyInjection\\Compiler\\CompilerPassInterface' not found in wp-content/plugins/motiforms/vendor/symfony/dependency-injection/Compiler/ResolveInvalidReferencesPass.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Form\\Button' not found in wp-content/plugins/motiforms/vendor/symfony/form/SubmitButton.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\DependencyInjection\\Compiler\\CompilerPassInterface' not found in wp-content/plugins/motiforms/vendor/symfony/dependency-injection/Compiler/ResolveReferencesToAliasesPass.php:25
    • > PHP Fatal error
      Cannot use Riak\\Object as Object because 'Object' is a special class name in wp-content/plugins/motiforms/vendor/doctrine/cache/lib/Doctrine/Common/Cache/RiakCache.php on line 26
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Templating\\Storage\\Storage' not found in wp-content/plugins/motiforms/vendor/symfony/templating/Storage/FileStorage.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Routing\\Exception\\ExceptionInterface' not found in wp-content/plugins/motiforms/vendor/symfony/routing/Exception/RouteNotFoundException.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Validator\\ContainerConstraintValidatorFactory' not found in wp-content/plugins/motiforms/vendor/symfony/framework-bundle/Validator/ConstraintValidatorFactory.php:45
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Cache\\CacheException' not found in wp-content/plugins/motiforms/vendor/symfony/cache/Exception/CacheException.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
6 plugin tags: forms, contact form, form, symfony, symfony form...

motiforms/motiforms.php 92% from 13 tests

This is the main PHP file of "Motiforms" version 0.1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin348,440 lines of code in 2,469 files:
LanguageFilesBlank linesComment linesLines of code
JSON90400247,176
PHP1,34919,68355,20075,696
XML1493813217,215
XSD8201765,754
Markdown5552902,292
C1528223
m41111141
C/C++ Header112840
Bourne Shell1203

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 155)
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity10.00
▷ Minimum class complexity1.00
▷ Maximum class complexity259.00
Average method complexity2.97
▷ Minimum method complexity1.00
▷ Maximum method complexity155.00
Code structure
Namespaces193
Interfaces177
Traits17
Classes1,054
▷ Abstract classes777.31%
▷ Concrete classes97792.69%
▷ Final classes242.46%
Methods6,026
▷ Static methods3004.98%
▷ Public methods4,67077.50%
▷ Protected methods70811.75%
▷ Private methods64810.75%
Functions339
▷ Named functions7622.42%
▷ Anonymous functions26377.58%
Constants537
▷ Global constants101.86%
▷ Class constants52798.14%
▷ Public constants527100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin