10% easy-mailchimp-opt-in

Code Review | Easy Mailchimp Optin Form

WordPress plugin Easy Mailchimp Optin Form scored10%from 54 tests.

About plugin

  • Plugin page: easy-mailchimp-op...
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-4.0
  • WordPress version: 6.3.1
  • First release: Aug 24, 2014
  • Latest release: Sep 9, 2014
  • Number of updates: 34
  • Update frequency: every 0.5 days
  • Top authors: mahfuzar (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

300+ active /14,610 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/easy-mailchimp-opt-in/includes/widgets.php+69
    Function create_function() is deprecated

Server metrics [RAM: ▼1.96MB] [CPU: ▼48.84ms] Passed 4 tests

Analyzing server-side resources used by Easy Mailchimp Optin Form
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.435.09 ▼37.07
Dashboard /wp-admin2.05 ▼1.267.54 ▼38.42
Posts /wp-admin/edit.php2.05 ▼1.317.42 ▼40.73
Add New Post /wp-admin/post-new.php2.05 ▼3.845.92 ▼79.15
Media Library /wp-admin/upload.php2.05 ▼1.185.85 ▼28.92
Mailchimp /wp-admin/options-general.php?page=mailchimp-optin2.056.15

Server storage [IO: ▲0.16MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 15 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_recent-posts
widget_pmc_wrapper
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Easy Mailchimp Optin Form
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲9414.44 ▲0.051.98 ▲0.2444.63 ▲4.70
Dashboard /wp-admin2,210 ▲284.87 ▼0.01102.63 ▼12.4042.08 ▼5.74
Posts /wp-admin/edit.php2,093 ▲42.06 ▲0.0936.33 ▼5.4433.86 ▲0.01
Add New Post /wp-admin/post-new.php1,536 ▼623.10 ▼0.03656.82 ▼25.0154.42 ▲3.61
Media Library /wp-admin/upload.php1,392 ▲74.16 ▼0.1393.63 ▼6.6639.95 ▼4.54
Mailchimp /wp-admin/options-general.php?page=mailchimp-optin8872.0624.4425.89

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/easy-mailchimp-opt-in/includes/widgets.php+69
    Function create_function() is deprecated
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_pmc_wrapper
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=mailchimp-optin
    • > Deprecated in wp-content/plugins/easy-mailchimp-opt-in/includes/widgets.php+69
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=mailchimp-optin
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in pmc_widget_wrapper is deprecated since version 4.3.0! Use __construct() instead.
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=mailchimp-optin
    • > Notice in wp-content/plugins/easy-mailchimp-opt-in/includes/settings.php+85
    Trying to access array offset on value of type bool

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
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/easy-mailchimp-opt-in/includes/functions.php:60
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/easy-mailchimp-opt-in/includes/widgets.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/easy-mailchimp-opt-in/includes/form.php:124
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/easy-mailchimp-opt-in/mailchimp-optin.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/easy-mailchimp-opt-in/includes/settings.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
You can take inspiration from this readme.txt

easy-mailchimp-opt-in/mailchimp-optin.php 92% from 13 tests

Analyzing the main PHP file in "Easy Mailchimp Optin Form" version 1.3
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("easy-mailchimp-opt-in.php" instead of "mailchimp-optin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected1,165 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP62051,6751,025
PO File25654140

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity13.50
▷ Minimum class complexity6.00
▷ Maximum class complexity21.00
Average method complexity1.24
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods104
▷ Static methods00.00%
▷ Public methods104100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
4 compressed PNG files occupy 0.00MB
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/red.png0.15KB0.24KB0.00%
images/email.png0.51KB0.59KB0.00%
images/dark.png0.13KB0.11KB▼ 12.40%
images/name.png0.64KB0.57KB▼ 11.33%