10% campaign-monitor-dashboard

Code Review | Campaign Monitor Dashboard

WordPress plugin Campaign Monitor Dashboard scored10%from 54 tests.

About plugin

  • Plugin page: campaign-monitor-...
  • Plugin version: 1.1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-4.3.1
  • WordPress version: 6.3.1
  • First release: Jul 18, 2013
  • Latest release: Nov 5, 2015
  • Number of updates: 80
  • Update frequency: every 10.5 days
  • Top authors: jakebresnehan (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

30+ active /3,376 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/campaign-monitor-dashboard/cm-php/csrest_subscribers.php+11
    Methods with the same name as their class will not be constructors in a future version of PHP; CS_REST_Subscribers has a deprecated constructor

Server metrics [RAM: ▼1.90MB] [CPU: ▼54.90ms] Passed 4 tests

Analyzing server-side resources used by Campaign Monitor Dashboard
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.375.60 ▼38.79
Dashboard /wp-admin2.11 ▼1.205.65 ▼44.78
Posts /wp-admin/edit.php2.11 ▼1.256.83 ▼44.55
Add New Post /wp-admin/post-new.php2.11 ▼3.785.81 ▼91.49
Media Library /wp-admin/upload.php2.11 ▼1.127.06 ▼27.44
Campaign Monitor /wp-admin/options-general.php?page=campaign-monitor-dashboard2.116.08

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 242 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_campaign_monitor_widget
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Campaign Monitor Dashboard
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.48 ▲0.102.09 ▲0.2245.45 ▲3.18
Dashboard /wp-admin2,210 ▲195.82 ▼0.08119.12 ▲19.6338.94 ▼4.68
Posts /wp-admin/edit.php2,093 ▲42.05 ▼0.0041.12 ▲4.4435.30 ▼1.48
Add New Post /wp-admin/post-new.php1,536 ▲1723.25 ▲0.46691.45 ▲100.0759.42 ▲4.84
Media Library /wp-admin/upload.php1,392 ▲44.19 ▲0.0194.61 ▼9.3843.15 ▼2.11
Campaign Monitor /wp-admin/options-general.php?page=campaign-monitor-dashboard1,0742.0634.2529.03

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/campaign-monitor-dashboard/cm-php/csrest_subscribers.php+11
    Methods with the same name as their class will not be constructors in a future version of PHP; CS_REST_Subscribers has a deprecated constructor
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_campaign_monitor_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=campaign-monitor-dashboard
    • > Deprecated in wp-content/plugins/campaign-monitor-dashboard/cm-php/csrest_subscribers.php+11
    Methods with the same name as their class will not be constructors in a future version of PHP; CS_REST_Subscribers has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=campaign-monitor-dashboard
    • > Deprecated in wp-content/plugins/campaign-monitor-dashboard/cm-php/class/base_classes.php+19
    Methods with the same name as their class will not be constructors in a future version of PHP; CS_REST_Wrapper_Result has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=campaign-monitor-dashboard
    • > Deprecated in wp-content/plugins/campaign-monitor-dashboard/cm-php/class/base_classes.php+54
    Methods with the same name as their class will not be constructors in a future version of PHP; CS_REST_Wrapper_Base has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=campaign-monitor-dashboard
    • > Deprecated in wp-content/plugins/campaign-monitor-dashboard/cm-php/class/serialisation.php+15
    Methods with the same name as their class will not be constructors in a future version of PHP; CS_REST_BaseSerialiser has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=campaign-monitor-dashboard
    • > Deprecated in wp-content/plugins/campaign-monitor-dashboard/cm-php/class/serialisation.php+49
    Methods with the same name as their class will not be constructors in a future version of PHP; CS_REST_DoNothingSerialiser has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=campaign-monitor-dashboard
    • > Deprecated in wp-content/plugins/campaign-monitor-dashboard/cm-php/class/serialisation.php+60
    Methods with the same name as their class will not be constructors in a future version of PHP; CS_REST_NativeJsonSerialiser has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=campaign-monitor-dashboard
    • > Deprecated in wp-content/plugins/campaign-monitor-dashboard/cm-php/class/serialisation.php+98
    Methods with the same name as their class will not be constructors in a future version of PHP; CS_REST_ServicesJsonSerialiser has a deprecated constructor
  • 40 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=campaign-monitor-dashboard
    • > Deprecated in wp-content/plugins/campaign-monitor-dashboard/cm-php/class/services_json.php+724
    Array and string offset access syntax with curly braces is deprecated
    • > GET request to /wp-admin/options-general.php?page=campaign-monitor-dashboard
    • > Deprecated in wp-content/plugins/campaign-monitor-dashboard/cm-php/class/services_json.php+114
    Methods with the same name as their class will not be constructors in a future version of PHP; Services_JSON has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=campaign-monitor-dashboard
    • > Deprecated in wp-content/plugins/campaign-monitor-dashboard/cm-php/class/services_json.php+773
    Methods with the same name as their class will not be constructors in a future version of PHP; Services_JSON_Error has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=campaign-monitor-dashboard
    • > Deprecated in wp-content/plugins/campaign-monitor-dashboard/cm-php/class/transport.php+33
    Methods with the same name as their class will not be constructors in a future version of PHP; CS_REST_BaseTransport has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=campaign-monitor-dashboard
    • > Deprecated in wp-content/plugins/campaign-monitor-dashboard/cm-php/class/transport.php+64
    Methods with the same name as their class will not be constructors in a future version of PHP; CS_REST_CurlTransport has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=campaign-monitor-dashboard
    • > Deprecated in wp-content/plugins/campaign-monitor-dashboard/cm-php/class/transport.php+209
    Methods with the same name as their class will not be constructors in a future version of PHP; CS_REST_SocketTransport has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=campaign-monitor-dashboard
    • > Deprecated in wp-content/plugins/campaign-monitor-dashboard/cm-php/class/log.php+7
    Methods with the same name as their class will not be constructors in a future version of PHP; CS_REST_Log has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=campaign-monitor-dashboard
    • > Deprecated in wp-content/plugins/campaign-monitor-dashboard/cm-php/csrest_lists.php+25
    Methods with the same name as their class will not be constructors in a future version of PHP; CS_REST_Lists has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=campaign-monitor-dashboard
    • > Deprecated in wp-content/plugins/campaign-monitor-dashboard/class-campaign-monitor-dashboard.php+84
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=campaign-monitor-dashboard
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=campaign-monitor-dashboard
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 0% 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
  • 168× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/campaign-monitor-dashboard/cm-php/samples/subscriber/get.php
    • > /wp-content/plugins/campaign-monitor-dashboard/trunk/cm-php/samples/list/test_webhook.php
    • > /wp-content/plugins/campaign-monitor-dashboard/cm-php/samples/client/get_suppressionlist.php
    • > /wp-content/plugins/campaign-monitor-dashboard/trunk/cm-php/samples/get_apikey.php
    • > /wp-content/plugins/campaign-monitor-dashboard/cm-php/samples/segment/clear_rules.php
    • > /wp-content/plugins/campaign-monitor-dashboard/cm-php/samples/client/set_monthly_billing.php
    • > /wp-content/plugins/campaign-monitor-dashboard/cm-php/samples/subscriber/update.php
    • > /wp-content/plugins/campaign-monitor-dashboard/trunk/cm-php/samples/list/get_segments.php
    • > /wp-content/plugins/campaign-monitor-dashboard/cm-php/samples/client/get_scheduled.php
    • > /wp-content/plugins/campaign-monitor-dashboard/cm-php/samples/client/delete.php
  • 38× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Trying to get property 'TotalNewSubscribers' of non-object in wp-content/plugins/campaign-monitor-dashboard/cm-php/samples/subscriber/import.php on line 68
    • > PHP Notice
      Trying to get property 'DuplicateEmailsInSubmission' of non-object in wp-content/plugins/campaign-monitor-dashboard/cm-php/samples/subscriber/import.php on line 70
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/campaign-monitor-dashboard/cm-php/samples/subscriber/import.php on line 70
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/campaign-monitor-dashboard/views/shortcode.php:48
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/campaign-monitor-dashboard/views/admin.php:18
    • > PHP Notice
      Trying to get property 'ListID' of non-object in wp-content/plugins/campaign-monitor-dashboard/cm-php/samples/list/list_webhook_receiver.php on line 22
    • > PHP Notice
      Trying to get property 'TotalExistingSubscribers' of non-object in wp-content/plugins/campaign-monitor-dashboard/trunk/cm-php/samples/subscriber/import.php on line 66
    • > PHP Notice
      Trying to get property 'error' of non-object in wp-content/plugins/campaign-monitor-dashboard/trunk/cm-php/samples/authentication/exchange_token.php on line 22
    • > PHP Notice
      Trying to get property 'error_description' of non-object in wp-content/plugins/campaign-monitor-dashboard/cm-php/samples/authentication/exchange_token.php on line 22
    • > PHP Notice
      Undefined property: stdClass::$ResultData in wp-content/plugins/campaign-monitor-dashboard/cm-php/samples/subscriber/import.php on line 68

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: email, stats, graph, campaign monitor, shortcode...

campaign-monitor-dashboard/campaign-monitor-dashboard.php Passed 13 tests

The main PHP file in "Campaign Monitor Dashboard" ver. 1.1.5 adds more information about the plugin and also serves as the entry point for this plugin
94 characters long description:
Display stats from your Campaign Monitor email list and easily add sign up forms to your site.

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
There were no executable files found in this plugin5,380 lines of code in 111 files:
LanguageFilesBlank linesComment linesLines of code
PHP1051,0352,5453,636
JavaScript2238741,182
CSS2462249
PO File17688214
Markdown152099

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity9.42
▷ Minimum class complexity1.00
▷ Maximum class complexity114.00
Average method complexity2.07
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes48
▷ Abstract classes00.00%
▷ Concrete classes48100.00%
▷ Final classes00.00%
Methods380
▷ Static methods102.63%
▷ Public methods37899.47%
▷ Protected methods00.00%
▷ Private methods20.53%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants74
▷ Global constants74100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/cm-icon-dashboard.png1.19KB0.28KB▼ 76.30%
assets/cm-icon.png1.33KB0.55KB▼ 58.77%
trunk/assets/cm-icon-dashboard.png1.19KB0.28KB▼ 76.30%
trunk/assets/cm-icon.png1.33KB0.55KB▼ 58.77%