72% mage-forms

Code Review | Mage Front End Forms

WordPress plugin Mage Front End Forms scored72%from 54 tests.

About plugin

  • Plugin page: mage-forms
  • Plugin version: 1.1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7
  • WordPress version: 6.3.1
  • First release: Mar 1, 2016
  • Latest release: Apr 12, 2017
  • Number of updates: 32
  • Update frequency: every 13.0 days
  • Top authors: Maximilian Ruthe (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

20+ active /5,240 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.70MB] [CPU: ▼4.48ms] Passed 4 tests

Analyzing server-side resources used by Mage Front End Forms
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.10 ▲0.6347.48 ▲4.81
Dashboard /wp-admin4.05 ▲0.7453.58 ▼6.61
Posts /wp-admin/edit.php4.09 ▲0.7348.94 ▼1.06
Add New Post /wp-admin/post-new.php6.68 ▲0.7986.43 ▼15.05
Media Library /wp-admin/upload.php3.93 ▲0.7047.82 ▲9.35
Add Form /wp-admin/post-new.php?post_type=mage_form4.1655.52
Help /wp-admin/edit.php?post_type=mage_form&page=mage_forms_help3.8438.01
Addons /wp-admin/edit.php?post_type=mage_form&page=mage_forms_addons3.8336.56
Forms /wp-admin/edit.php?post_type=mage_form4.0543.38

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 54 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Mage Front End Forms: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲4414.32 ▼0.032.03 ▼0.0643.82 ▼0.93
Dashboard /wp-admin2,214 ▲435.56 ▼0.1086.12 ▼9.0876.94 ▲33.58
Posts /wp-admin/edit.php2,137 ▲371.97 ▲0.0337.25 ▲0.9034.07 ▼4.22
Add New Post /wp-admin/post-new.php1,711 ▲17422.18 ▲4.01692.26 ▲67.4856.59 ▼15.94
Media Library /wp-admin/upload.php1,434 ▲374.17 ▼0.0098.79 ▼0.6061.67 ▲15.98
Add Form /wp-admin/post-new.php?post_type=mage_form2,5297.68188.83165.24
Help /wp-admin/edit.php?post_type=mage_form&page=mage_forms_help1,8432.2929.04132.61
Addons /wp-admin/edit.php?post_type=mage_form&page=mage_forms_addons9481.9925.4649.91
Forms /wp-admin/edit.php?post_type=mage_form1,6481.9942.2941.47

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 17 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=mage_form&page=mage_forms_addons
    • > Warning in wp-content/plugins/mage-forms/core/mage-cast.php+190
    preg_replace(): Compilation failed: invalid range in character class at offset 13

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/mage-forms/core/mage-cast.php:31

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/post-new.php?post_type=mage_form
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $mage_form_type.live is not a function" "TypeError: $mage_form_type.live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/mage-forms/source/js/mage-forms.js?ver=6.3.1:6:18)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/post-new.php?post_type=mage_form
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $mage_form_type.live is not a function
    • > GET request to /wp-admin/edit.php?post_type=mage_form&page=mage_forms_help
    • > Network (severe)
    wp-content/plugins/mage-forms/core/images/arrow-down.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=mage_form&page=mage_forms_addons
    • > Network (severe)
    wp-content/plugins/mage-forms/addons/thumbnails/mage_forms_pro.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 17 tag instead of maximum 10
The official readme.txt is a good inspiration

mage-forms/mage-forms.php 92% from 13 tests

"Mage Front End Forms" version 1.1.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Domain Path: The domain path folder does not exist ("/lang/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin12,205 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
CSS71,1591088,488
PHP8642723,006
SVG200403
JavaScript84051308

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods2
▷ Static methods00.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions108
▷ Named functions108100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
18 compressed PNG files occupy 0.23MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
source/img/glyphicons-halflings-white.png8.57KB9.20KB0.00%
source/img/60pc_black.png0.11KB0.09KB▼ 12.84%
addons/thumbnails/mage_listings.png18.84KB8.51KB▼ 54.83%
source/img/select2x2.png0.83KB0.77KB▼ 6.15%
source/img/gear.png1.14KB1.19KB0.00%