10% campaign

Code Review | Campaign

WordPress plugin Campaign scored10%from 54 tests.

About plugin

  • Plugin page: campaign
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-4.8.1
  • WordPress version: 6.3.1
  • First release: Dec 16, 2014
  • Latest release: Sep 4, 2017
  • Number of updates: 13
  • Update frequency: every 80.9 days
  • Top authors: iwcontribution (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,380 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Error in wp-content/plugins/campaign/admin/camp_table_view_class.php+5
    Uncaught Error: Class 'IW_List_Table' not found in wp-content/plugins/campaign/admin/camp_table_view_class.php:5
    Stack trace:
    #0 wp-content/plugins/campaign/load.php(16): require_once()
    #1 wp-content/plugins/campaign/campaign_plugin.php(69): require_once('/var/www/wordpr...')
    #2 wp-admin/includes/plugin.php(2318): include_once('/var/www/wordpr...')
    #3 wp-admin/includes/plugin.php(663): plugin_sandbox_scrape()

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

A check of server-side resources used by Campaign
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0042.17 ▼9.41
Dashboard /wp-admin3.31 ▲0.0051.00 ▲0.07
Posts /wp-admin/edit.php3.36 ▲0.0049.35 ▼4.96
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.86 ▼19.91
Media Library /wp-admin/upload.php3.23 ▲0.0035.64 ▲1.16

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 44 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Campaign: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.31 ▼1.061.67 ▼0.3044.02 ▲0.84
Dashboard /wp-admin2,209 ▲245.86 ▲0.80106.74 ▼2.1140.97 ▼0.84
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0635.22 ▼5.8234.80 ▼0.98
Add New Post /wp-admin/post-new.php1,542 ▲2818.37 ▲0.80644.46 ▼2.7858.29 ▲11.22
Media Library /wp-admin/upload.php1,379 ▼34.21 ▲0.0099.88 ▲1.0342.31 ▼1.76

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
  • 12× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/campaign/admin/fund_table_view_class.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/campaign/campaign_plugin.php:17
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/campaign/admin/fund_table_view_class.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/campaign/camp_shortcode.php:2
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/campaign/admin/fund_table_view_class.php on line 4
    • > PHP Warning
      require_once(CAMPAIGN_PLUGIN_PATH/lib/camp_function_class.php): failed to open stream: No such file or directory in wp-content/plugins/campaign/load.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/campaign/cp_post_type.php:2
    • > PHP Fatal error
      require_once(): Failed opening required 'CAMPAIGN_PLUGIN_PATH/lib/camp_function_class.php' (include_path='.:/usr/share/php') in wp-content/plugins/campaign/load.php on line 2
    • > PHP Warning
      require_once(class-wp-list-table): failed to open stream: No such file or directory in wp-content/plugins/campaign/admin/camp_table_view_class.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'class-wp-list-table' (include_path='.:/usr/share/php') in wp-content/plugins/campaign/admin/camp_table_view_class.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
1 plugin tags: campaign

campaign/campaign_plugin.php 92% from 13 tests

The entry point to "Campaign" version 1.1 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("campaign.php" instead of "campaign_plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin1,447 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP203075321,212
JavaScript1350234
CSS1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity27.50
▷ Minimum class complexity1.00
▷ Maximum class complexity85.00
Average method complexity3.16
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods49
▷ Static methods00.00%
▷ Public methods49100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions32
▷ Named functions32100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
17 PNG files occupy 1.38MB with 0.89MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-5.png28.83KB14.97KB▼ 48.08%
images/camp_twitter.png0.59KB0.47KB▼ 20.56%
images/camp_btn_bg.png3.10KB0.46KB▼ 85.12%
images/search_bg.png2.93KB0.24KB▼ 91.96%
assets/screenshot-2.png1,068.85KB261.57KB▼ 75.53%