77% olalaweb-mailchimp-campaign-manager

Code Review | MailChimp Campaigns

WordPress plugin MailChimp Campaigns scored 77% from 54 tests.

About plugin

  • Plugin page: olalaweb-mailchim...
  • Plugin version: 3.2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-5.2.1
  • WordPress version: 6.3.1
  • First release: Oct 7, 2014
  • Latest release: Jul 1, 2019
  • Number of updates: 121
  • Update frequency: every 14.3 days
  • Top authors: OlalaWeb (73.55%)matthieuscarset (27.27%)

Code review

54 tests

User reviews

9 reviews

Install metrics

900+ active / 21,027 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.23MB] [CPU: ▼9.07ms] Passed 4 tests

Server-side resources used by MailChimp Campaigns
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.3038.66 ▼3.25
Dashboard /wp-admin3.58 ▲0.2837.12 ▼13.38
Posts /wp-admin/edit.php3.65 ▲0.2940.70 ▼11.62
Add New Post /wp-admin/post-new.php5.93 ▲0.0484.20 ▼8.03
Media Library /wp-admin/upload.php3.59 ▲0.3635.88 ▲0.82
Import /wp-admin/edit.php?post_type=newsletter&page=mailchimp_campaigns_manager-import3.5635.48
Add New /wp-admin/post-new.php?post_type=newsletter5.9171.04
All newsletter /wp-admin/edit.php?post_type=newsletter3.6340.14
Settings /wp-admin/edit.php?post_type=newsletter&page=mailchimp_campaigns_manager-admin3.5634.99

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for MailChimp Campaigns
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,852 ▲11713.28 ▼1.151.69 ▼0.1337.17 ▼6.86
Dashboard /wp-admin2,249 ▲614.94 ▼0.96103.40 ▼10.6438.19 ▼8.63
Posts /wp-admin/edit.php2,132 ▲432.25 ▲0.2538.97 ▲1.4438.55 ▲1.67
Add New Post /wp-admin/post-new.php1,554 ▲3023.50 ▲0.27623.83 ▼21.4962.32 ▲4.02
Media Library /wp-admin/upload.php1,434 ▲464.27 ▲0.1198.69 ▲2.6342.75 ▼4.05
Import /wp-admin/edit.php?post_type=newsletter&page=mailchimp_campaigns_manager-import8131.7325.9824.96
Add New /wp-admin/post-new.php?post_type=newsletter6,49221.33812.3435.24
All newsletter /wp-admin/edit.php?post_type=newsletter1,1562.1833.0131.79
Settings /wp-admin/edit.php?post_type=newsletter&page=mailchimp_campaigns_manager-admin8761.7724.5429.85

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=newsletter&page=mailchimp_campaigns_manager-admin
    • > User deprecated in wp-includes/functions.php+5828
    Hook contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead.

SRP 50% 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
Almost there! Just fix the following items
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/olalaweb-mailchimp-campaign-manager/lib/basic-auth.php:87
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/olalaweb-mailchimp-campaign-manager/mailchimp-campaigns.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'MailchimpCampaignsManager' not found in wp-content/plugins/olalaweb-mailchimp-campaign-manager/class/MailchimpCustomPostType.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/olalaweb-mailchimp-campaign-manager/class/MailchimpCampaignsManager.php:53
    • > PHP Fatal error
      Uncaught Error: Class 'MailchimpCampaignsManager' not found in wp-content/plugins/olalaweb-mailchimp-campaign-manager/class/MailchimpCampaign.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'MailchimpCampaignsManager' not found in wp-content/plugins/olalaweb-mailchimp-campaign-manager/class/MailchimpCampaigns.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'MailchimpCampaignsManager' not found in wp-content/plugins/olalaweb-mailchimp-campaign-manager/class/MailchimpAdmin.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: newsletter, mailchimp stats, mailchimp, shortcodes, shortcode...

olalaweb-mailchimp-campaign-manager/mailchimp-campaigns-manager.php 69% from 13 tests

The main PHP file in "MailChimp Campaigns" ver. 3.2.4 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("olalaweb-mailchimp-campaign-manager.php" instead of "mailchimp-campaigns-manager.php")
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase
  • Domain Path: Note that the domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("languages/")
  • Domain Path: The domain path must begin with a forward slash character ("/languages/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected1,921 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP122655601,403
PO File17274157
JavaScript1419138
SVG1110116
CSS5112107

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity23.14
▷ Minimum class complexity6.00
▷ Maximum class complexity55.00
Average method complexity3.54
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods60
▷ Static methods11.67%
▷ Public methods60100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions41
▷ Named functions4097.56%
▷ Anonymous functions12.44%
Constants10
▷ Global constants10100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
8 PNG files occupy 1.14MB with 0.41MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-4.png273.70KB74.62KB▼ 72.74%
assets/screenshot-1.png42.17KB23.88KB▼ 43.36%
assets/icon-128x128.png9.48KB4.24KB▼ 55.28%
assets/banner-772x250.png5.44KB5.08KB▼ 6.75%
assets/banner-1544x500.png12.45KB12.02KB▼ 3.44%