48% campaigndot

Code Review | CampaignDot

WordPress plugin CampaignDot scored48%from 54 tests.

About plugin

  • Plugin page: campaigndot
  • Plugin version: 2.5.0
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Nov 23, 2016
  • Latest release: Nov 19, 2023
  • Number of updates: 158
  • Update frequency: every 16.1 days
  • Top authors: geraldmorales (86.71%)francois09 (13.92%)

Code review

54 tests

User reviews

2 reviews

Install metrics

60+ active /3,481 total downloads

Benchmarks

Plugin footprint 48% 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.35MB] [CPU: ▼0.15ms] Passed 4 tests

This is a short check of server-side resources used by CampaignDot
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.78 ▲0.3238.04 ▼1.73
Dashboard /wp-admin3.72 ▲0.4251.38 ▲3.89
Posts /wp-admin/edit.php3.77 ▲0.4254.75 ▲10.34
Add New Post /wp-admin/post-new.php6.24 ▲0.3584.77 ▼5.88
Media Library /wp-admin/upload.php3.56 ▲0.3338.48 ▲3.12
Help /wp-admin/admin.php?page=corporate-info-page3.5638.04
Corporate infos /wp-admin/admin.php?page=corporate-main-page3.5642.77
Banner /wp-admin/admin.php?page=corporate_banner_page3.5640.32

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 600 new files
Database: 2 new tables, 7 new options
New tables
wp_wes_banner_stats
wp_wes_months
New WordPress options
wes_banner_mode
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

CampaignDot: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,125 ▲36315.48 ▲1.135.89 ▲4.3441.46 ▼4.81
Dashboard /wp-admin2,411 ▲2346.53 ▲0.89130.35 ▲29.8838.29 ▼6.69
Posts /wp-admin/edit.php2,342 ▲2423.30 ▲1.3450.90 ▲4.0626.63 ▼11.99
Add New Post /wp-admin/post-new.php1,609 ▲8023.56 ▲0.43663.99 ▼46.0938.75 ▼9.01
Media Library /wp-admin/upload.php1,479 ▲824.53 ▲0.2487.22 ▼14.5938.49 ▼5.85
Help /wp-admin/admin.php?page=corporate-info-page1,1753.3646.9694.59
Corporate infos /wp-admin/admin.php?page=corporate-main-page1,7133.7569.3972.49
Banner /wp-admin/admin.php?page=corporate_banner_page1,2063.4545.4974.09

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, function 'wes_cleanTransient' not found or invalid function name
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_wes_months
    • wp_wes_banner_stats
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • wes_banner_mode
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/campaigndot/admin/template/CampaignDot-help.php
    • > /wp-content/plugins/campaigndot/include/phpqrcode/index.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_query_var() in wp-content/plugins/campaigndot/template/wes_banner.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Tags: Please delete some tags, you are using 18 tag instead of maximum 10
You can take inspiration from this readme.txt

campaigndot/campaigndot.php 92% from 13 tests

"CampaignDot" version 2.5.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 278 characters long)

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
These items require your attention
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/campaigndot/include/phpqrcode/tools/merge.bat
24,062 lines of code in 87 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript111,14867610,076
PHP502,4702,5969,756
PO File67929492,524
CSS5198531,050
SVG13013652
Bourne Shell1002
DOS Batch1002

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity32.68
▷ Minimum class complexity1.00
▷ Maximum class complexity292.00
Average method complexity3.90
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes34
▷ Abstract classes00.00%
▷ Concrete classes34100.00%
▷ Final classes00.00%
Methods371
▷ Static methods12232.88%
▷ Public methods27173.05%
▷ Protected methods9625.88%
▷ Private methods41.08%
Functions73
▷ Named functions6994.52%
▷ Anonymous functions45.48%
Constants102
▷ Global constants102100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
104 PNG files occupy 0.54MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
include/phpqrcode/cache/frame_29.png0.23KB0.21KB▼ 7.76%
img/social-icons/round-color/linkedin.png0.91KB0.47KB▼ 47.85%
img/generic-signature.png42.49KB45.13KB0.00%
img/icon-style/minimal.png2.94KB1.33KB▼ 54.87%
include/phpqrcode/cache/frame_27.png0.23KB0.22KB▼ 6.33%