78% campaignpress

Code Review | CampaignPress

WordPress plugin CampaignPress scored78%from 54 tests.

About plugin

  • Plugin page: campaignpress
  • Plugin version: 1.0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1
  • WordPress version: 6.3.1
  • First release: Mar 1, 2023
  • Latest release: Mar 22, 2023
  • Number of updates: 10
  • Update frequency: every 2.5 days
  • Top authors: orchestrated (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /221 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.07MB] [CPU: ▲0.80ms] Passed 4 tests

This is a short check of server-side resources used by CampaignPress
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0442.61 ▲3.57
Dashboard /wp-admin3.39 ▲0.0849.64 ▲0.95
Posts /wp-admin/edit.php3.48 ▲0.1253.84 ▲6.07
Add New Post /wp-admin/post-new.php5.97 ▲0.0985.60 ▼7.35
Media Library /wp-admin/upload.php3.28 ▲0.0537.45 ▲6.04
– Settings /wp-admin/options-general.php?page=orchestrated_campaignpress_settings3.2735.71
CampaignPress /wp-admin/options-general.php?page=orchestrated_campaignpress_general3.2736.86

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

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

Browser metrics Passed 4 tests

CampaignPress: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,995 ▲26016.29 ▲1.911.89 ▲0.2042.71 ▼4.24
Dashboard /wp-admin2,371 ▲1807.16 ▲2.25143.87 ▲42.2441.02 ▼0.43
Posts /wp-admin/edit.php2,423 ▲3344.57 ▲2.6062.06 ▲27.2235.13 ▲0.26
Add New Post /wp-admin/post-new.php1,698 ▲16123.01 ▲4.79688.82 ▲77.3633.52 ▼16.66
Media Library /wp-admin/upload.php1,566 ▲1814.96 ▲0.5891.25 ▼12.1240.57 ▼0.50
– Settings /wp-admin/options-general.php?page=orchestrated_campaignpress_settings1,1496.09144.9227.29
CampaignPress /wp-admin/options-general.php?page=orchestrated_campaignpress_general1,1736.1263.0731.23

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • orchestrated_campaignpress_version
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • orchestrated_campaignpress_toast_messages
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
  • 49× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\BadResponseException' not found in wp-content/plugins/campaignpress/vendor/guzzlehttp/guzzle/src/Exception/ClientException.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Cookie\\CookieJarInterface' not found in wp-content/plugins/campaignpress/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/campaignpress/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Handler\\CurlFactoryInterface' not found in wp-content/plugins/campaignpress/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\ResponseInterface' not found in wp-content/plugins/campaignpress/vendor/guzzlehttp/psr7/src/Response.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/campaignpress/vendor/guzzlehttp/promises/src/Coroutine.php:45
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/campaignpress/vendor/guzzlehttp/psr7/src/CachingStream.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/campaignpress/vendor/guzzlehttp/psr7/src/NoSeekStream.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Promise\\RejectionException' not found in wp-content/plugins/campaignpress/vendor/guzzlehttp/promises/src/CancellationException.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'MailchimpTransactional\\Configuration' not found in wp-content/plugins/campaignpress/vendor/mailchimp/transactional/lib/ApiClient.php:7

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
These are user-side errors you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=orchestrated_campaignpress_settings
    • > Console-api (warning) in wp-content/plugins/campaignpress//js/dist/app.js?ver=1.0+2:20
    [Vue warn]: Failed to resolve directive: scroll" "\n" " at \u003CSettingsViewFree" "key=1" ">" "\n" " at \u003CAppFree>
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=orchestrated_campaignpress_settings
    • > Console-api (warning) in wp-content/plugins/campaignpress//js/dist/app.js?ver=1.0+2:20
    [Vue warn]: Property \"panelScrolled\" was accessed during render but is not defined on instance." "\n" " at \u003CSettingsViewFree" "key=1" ">" "\n" " at \u003CAppFree>
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=orchestrated_campaignpress_settings
    • > Console-api (warning) in wp-content/plugins/campaignpress//js/dist/app.js?ver=1.0+2:20
    [Vue warn]: Invalid prop: type check failed for prop \"settings\". Expected Object, got Null " "\n" " at \u003CSettingsPanelGeneral" "class=\"\"" "onUpdate=fn\u003Cbound panelGeneralUpdated>" "onRemoveTemplates=fn\u003Cbound panelGeneralRemoveTemplatesClicked>" " ..." ">" "\n" " at \u003CSettingsViewFree" "key=1" ">" "\n" " at \u003CAppFree>
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=orchestrated_campaignpress_settings
    • > Console-api (warning) in wp-content/plugins/campaignpress//js/dist/app.js?ver=1.0+2:20
    [Vue warn]: Failed to resolve component: loading-indicator\nIf this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement." "\n" " at \u003CSettingsPanelGeneral" "class=\"\"" "onUpdate=fn\u003Cbound panelGeneralUpdated>" "onRemoveTemplates=fn\u003Cbound panelGeneralRemoveTemplatesClicked>" " ..." ">" "\n" " at \u003CSettingsViewFree" "key=1" ">" "\n" " at \u003CAppFree>
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=orchestrated_campaignpress_general
    • > Console-api (warning) in wp-content/plugins/campaignpress//js/dist/app.js?ver=1.0+2:20
    [Vue warn]: Failed to mount app: mount target selector \"#campaignpress-metabox\" returned null.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=orchestrated_campaignpress_general
    • > Network (severe)
    wp-json/campaignpress/v1/settings - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=orchestrated_campaignpress_general
    • > Console-api (warning) in wp-content/plugins/campaignpress//js/dist/app.js?ver=1.0+2:20
    [Vue warn]: Invalid prop: type check failed for prop \"audienceSettings\". Expected Object, got Null " "\n" " at \u003CGeneralPanelContextHelp" "tab=\"guided_setup_step_intro_1\"" "audience-settings=null" "plugin-root-dir=null" ">" "\n" " at \u003CGuidedSetupViewFree" "key=2" ">" "\n" " at \u003CAppFree>
    • > GET request to /wp-admin/options-general.php?page=orchestrated_campaignpress_general
    • > Console-api (warning) in wp-content/plugins/campaignpress//js/dist/app.js?ver=1.0+2:20
    [Vue warn]: Invalid prop: type check failed for prop \"pluginRootDir\". Expected String with value \"null\", got Null " "\n" " at \u003CGeneralPanelContextHelp" "tab=\"guided_setup_step_intro_1\"" "audience-settings=null" "plugin-root-dir=null" ">" "\n" " at \u003CGuidedSetupViewFree" "key=2" ">" "\n" " at \u003CAppFree>
    • > GET request to /wp-admin/options-general.php?page=orchestrated_campaignpress_general
    • > Network (severe)
    wp-admin/null/js/dist/thumbnail-setup.jpg - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: campaign, mailchimp, mailchimp campaign, send mailchimp, merge tags

campaignpress/orchestrated-campaignpress.php 77% from 13 tests

"CampaignPress" version 1.0.9's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("5.0" instead of "4.0")
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("campaignpress.php" instead of "orchestrated-campaignpress.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected19,630 lines of code in 190 files:
LanguageFilesBlank linesComment linesLines of code
PHP1452,9707,88912,787
Markdown201,40804,051
CSS34071531,425
JSON13201,223
Bourne Shell217842
JavaScript262840
HTML21025
XML11020
YAML20017

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity13.29
▷ Minimum class complexity1.00
▷ Maximum class complexity184.00
Average method complexity2.59
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces14
Interfaces26
Traits3
Classes102
▷ Abstract classes00.00%
▷ Concrete classes102100.00%
▷ Final classes3534.31%
Methods993
▷ Static methods15815.91%
▷ Public methods82482.98%
▷ Protected methods40.40%
▷ Private methods16516.62%
Functions155
▷ Named functions3623.23%
▷ Anonymous functions11976.77%
Constants64
▷ Global constants00.00%
▷ Class constants64100.00%
▷ Public constants5382.81%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
dist/menu_icon.png0.63KB0.43KB▼ 31.73%