68% moptin-email-subscription-optin-form

Code Review | Moptin - Email Subscription Optin form

WordPress plugin Moptin - Email Subscription Optin form scored68%from 54 tests.

About plugin

  • Plugin page: moptin-email-subs...
  • Plugin version: 2016.11.13.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.6
  • WordPress version: 6.3.1
  • First release: Jun 30, 2016
  • Latest release: Nov 15, 2016
  • Number of updates: 27
  • Update frequency: every 5.0 days
  • Top authors: mycodingtricks (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,234 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.16MB] [CPU: ▼43.02ms] Passed 4 tests

Server-side resources used by Moptin - Email Subscription Optin form
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.82 ▼0.6414.18 ▼25.31
Dashboard /wp-admin2.86 ▼0.4814.89 ▼46.22
Posts /wp-admin/edit.php2.86 ▼0.4915.81 ▼26.71
Add New Post /wp-admin/post-new.php2.86 ▼3.0215.38 ▼73.82
Media Library /wp-admin/upload.php2.86 ▼0.3717.32 ▼17.61
Add New /wp-admin/post-new.php?post_type=moptin2.8616.31
Moptin /wp-admin/edit.php?post_type=moptin2.8615.31

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Moptin - Email Subscription Optin form
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,958 ▲19713.63 ▼0.644.99 ▲3.2639.81 ▼0.54
Dashboard /wp-admin2,249 ▲855.76 ▲0.1987.65 ▼37.9239.97 ▼3.83
Posts /wp-admin/edit.php2,159 ▲802.28 ▲0.2641.92 ▲4.7737.79 ▲3.80
Add New Post /wp-admin/post-new.php1,580 ▲5223.04 ▼0.19618.58 ▼38.0934.19 ▼49.39
Media Library /wp-admin/upload.php1,457 ▲574.48 ▲0.3898.98 ▼10.8541.89 ▲0.21
Add New /wp-admin/post-new.php?post_type=moptin3,1314.52121.2981.60
Moptin /wp-admin/edit.php?post_type=moptin1,1172.2436.6629.46

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/moptin-email-subscription-optin-form/moptin-post-type.php+19
    Use of undefined constant fasle - assumed 'fasle' (this will throw an Error in a future version of PHP)
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=moptin
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/moptin-email-subscription-optin-form/moptin-post-type.php+19
    Use of undefined constant fasle - assumed 'fasle' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/post-new.php?post_type=moptin
    • > Notice in wp-content/plugins/moptin-email-subscription-optin-form/index.php+36
    Undefined index: moptin-11

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/moptin-email-subscription-optin-form/meta-box.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/moptin-email-subscription-optin-form/moptin-post-type.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/moptin-email-subscription-optin-form/moptin-post-type.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Screenshots: Screenshot #4 (Create Moptin Form from Admin Panel) image missing
The official readme.txt might help

moptin-email-subscription-optin-form/index.php 85% from 13 tests

This is the main PHP file of "Moptin - Email Subscription Optin form" version 2016.11.13.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("moptin-email-subscription-optin-form.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected813 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP34173487
CSS160176
JavaScript2818150

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity28.00
▷ Minimum class complexity28.00
▷ Maximum class complexity28.00
Average method complexity3.45
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods19.09%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin