78% as-memberpress-campaign-monitor-integration

Code Review | AS MemberPress Campaign Monitor Integration

WordPress plugin AS MemberPress Campaign Monitor Integration scored78%from 54 tests.

About plugin

  • Plugin page: as-memberpress-ca...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.5.2
  • WordPress version: 6.3.1
  • First release: Mar 15, 2020
  • Latest release: Aug 5, 2020
  • Number of updates: 5
  • Update frequency: every 29.0 days
  • Top authors: aksharsoftsolutions (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /511 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼4.94ms] Passed 4 tests

A check of server-side resources used by AS MemberPress Campaign Monitor Integration
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.74 ▼4.47
Dashboard /wp-admin3.31 ▲0.0048.71 ▲0.85
Posts /wp-admin/edit.php3.36 ▲0.0045.53 ▼3.97
Add New Post /wp-admin/post-new.php5.89 ▲0.0087.49 ▼8.52
Media Library /wp-admin/upload.php3.23 ▲0.0038.19 ▼2.80

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

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

Browser metrics Passed 4 tests

Checking browser requirements for AS MemberPress Campaign Monitor Integration
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.23 ▼0.321.69 ▼0.3746.07 ▲1.44
Dashboard /wp-admin2,195 ▲185.56 ▼0.0196.13 ▲0.7043.08 ▼0.70
Posts /wp-admin/edit.php2,100 ▼01.97 ▼0.0138.53 ▲1.4133.24 ▼4.68
Add New Post /wp-admin/post-new.php1,526 ▼022.97 ▼0.17654.91 ▼60.5264.17 ▲7.69
Media Library /wp-admin/upload.php1,397 ▼34.15 ▼0.02103.21 ▲6.9744.16 ▲2.29

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 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 96× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/as-memberpress-campaign-monitor-integration/lib/samples/client/get_lists.php
    • > /wp-content/plugins/as-memberpress-campaign-monitor-integration/lib/samples/client/get_segments.php
    • > /wp-content/plugins/as-memberpress-campaign-monitor-integration/lib/samples/journeys/get_journey_opens.php
    • > /wp-content/plugins/as-memberpress-campaign-monitor-integration/lib/samples/subscriber/get.php
    • > /wp-content/plugins/as-memberpress-campaign-monitor-integration/lib/samples/list/get_segments.php
    • > /wp-content/plugins/as-memberpress-campaign-monitor-integration/lib/samples/client/get_drafts.php
    • > /wp-content/plugins/as-memberpress-campaign-monitor-integration/lib/samples/campaign/send_preview.php
    • > /wp-content/plugins/as-memberpress-campaign-monitor-integration/lib/samples/segment/get_subscribers.php
    • > /wp-content/plugins/as-memberpress-campaign-monitor-integration/lib/samples/client/set_payg_billing.php
    • > /wp-content/plugins/as-memberpress-campaign-monitor-integration/lib/samples/transactional/classic_groups.php
  • 54× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/as-memberpress-campaign-monitor-integration/lib/tests/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/as-memberpress-campaign-monitor-integration/lib/tests/all_tests.php on line 2
    • > PHP Warning
      require_once(wp-content/plugins/as-memberpress-campaign-monitor-integration/lib/tests/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/as-memberpress-campaign-monitor-integration/lib/tests/csrest_template_test.php on line 3
    • > PHP Notice
      Trying to get property 'Events' of non-object in wp-content/plugins/as-memberpress-campaign-monitor-integration/lib/samples/list/list_webhook_receiver.php on line 25
    • > PHP Notice
      Trying to get property 'ListID' of non-object in wp-content/plugins/as-memberpress-campaign-monitor-integration/lib/samples/list/list_webhook_receiver.php on line 22
    • > PHP Notice
      Undefined property: stdClass::$ResultData in wp-content/plugins/as-memberpress-campaign-monitor-integration/lib/samples/subscriber/import.php on line 68
    • > PHP Warning
      require_once(wp-content/plugins/as-memberpress-campaign-monitor-integration/lib/tests/class_tests/../../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/as-memberpress-campaign-monitor-integration/lib/tests/class_tests/response_tests.php on line 3
    • > PHP Warning
      require_once(wp-content/plugins/as-memberpress-campaign-monitor-integration/lib/tests/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/as-memberpress-campaign-monitor-integration/lib/tests/csrest_clients_test.php on line 3
    • > PHP Warning
      require_once(wp-content/plugins/as-memberpress-campaign-monitor-integration/lib/tests/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/as-memberpress-campaign-monitor-integration/lib/tests/all_tests.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined method CS_REST_General::get_apikey() in wp-content/plugins/as-memberpress-campaign-monitor-integration/lib/samples/get_apikey.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined method CS_REST_Journeys::get_summary() in wp-content/plugins/as-memberpress-campaign-monitor-integration/lib/samples/journeys/get_journey_summary.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 90% 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
Please fix the following attributes: You can take inspiration from this readme.txt

as-memberpress-campaign-monitor-integration/memberpress-campaign-monitor.php 85% from 13 tests

Analyzing the main PHP file in "AS MemberPress Campaign Monitor Integration" version 1.0.0
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("as-memberpress-campaign-monitor-integration.php" instead of "memberpress-campaign-monitor.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 detected8,333 lines of code in 194 files:
LanguageFilesBlank linesComment linesLines of code
PHP1391,6543,0256,902
JSON50001,051
Markdown41520362
YAML12018

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.15
Average class complexity4.42
▷ Minimum class complexity1.00
▷ Maximum class complexity114.00
Average method complexity1.69
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes69
▷ Abstract classes1217.39%
▷ Concrete classes5782.61%
▷ Final classes00.00%
Methods343
▷ Static methods20.58%
▷ Public methods33898.54%
▷ Protected methods00.00%
▷ Private methods51.46%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants37
▷ Global constants37100.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
There are no PNG files in this plugin