84% mailchimp-subscribe-widget

Code Review | MailChimp Subscribe Widget

WordPress plugin MailChimp Subscribe Widget scored84%from 54 tests.

About plugin

  • Plugin page: mailchimp-subscri...
  • Plugin version: 0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.0
  • WordPress version: 6.3.1
  • First release: Oct 3, 2014
  • Latest release: Oct 3, 2014
  • Number of updates: 8
  • Update frequency: N/A
  • Top authors: shonezlo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,556 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.67MB] [CPU: ▼3.07ms] Passed 4 tests

A check of server-side resources used by MailChimp Subscribe Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.14 ▲0.6846.45 ▲5.20
Dashboard /wp-admin3.97 ▲0.6755.05 ▲3.58
Posts /wp-admin/edit.php4.09 ▲0.7349.04 ▼5.36
Add New Post /wp-admin/post-new.php6.55 ▲0.6787.35 ▼14.40
Media Library /wp-admin/upload.php3.90 ▲0.6739.52 ▲3.90

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 29 new files
Database: no new tables, 7 new options
New WordPress options
widget_mcsubscribewidget
db_upgraded
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for MailChimp Subscribe Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,883 ▲13713.60 ▼0.699.50 ▲7.5742.36 ▼0.98
Dashboard /wp-admin2,203 ▲155.76 ▼0.05100.45 ▼15.9639.50 ▼3.51
Posts /wp-admin/edit.php2,089 ▼02.02 ▲0.0236.80 ▼1.2134.49 ▲2.11
Add New Post /wp-admin/post-new.php1,533 ▼923.21 ▲5.04628.60 ▼50.9456.52 ▼7.41
Media Library /wp-admin/upload.php1,385 ▼04.23 ▲0.0098.76 ▼1.4143.22 ▼1.89

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_mcsubscribewidget
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/mailchimp-subscribe-widget/McSubscribeWidget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mailchimp-subscribe-widget/ajax-handler.php:75
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/mailchimp-subscribe-widget/McSubscribeWidget.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 97% 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 need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (screenshot-1.png), #2 (screenshot-2.png), #3 (screenshot-3.png), #4 (screenshot-4.png)
The official readme.txt might help

mailchimp-subscribe-widget/mailchimp-subscribe-widget.php Passed 13 tests

The principal PHP file in "MailChimp Subscribe Widget" v. 0.9 is loaded by WordPress automatically on each request
48 characters long description:
This plugin creates a "subscribe to list" widget

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
There were no executable files found in this plugin1,146 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP193542,2791,077
JavaScript16027
JSON10021
CSS14014
Markdown1607

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity1.23
▷ Minimum class complexity1.00
▷ Maximum class complexity21.00
Average method complexity1.18
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes111
▷ Abstract classes00.00%
▷ Concrete classes111100.00%
▷ Final classes00.00%
Methods147
▷ Static methods00.00%
▷ Public methods147100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
4 PNG files occupy 0.47MB with 0.31MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png137.88KB48.30KB▼ 64.97%
screenshot-2.png144.58KB50.00KB▼ 65.42%
screenshot-4.png149.03KB50.31KB▼ 66.24%
screenshot-3.png51.83KB18.55KB▼ 64.21%