73% campaign-url-builder

Code Review | Campaign URL Builder

WordPress plugin Campaign URL Builder scored73%from 54 tests.

About plugin

  • Plugin page: campaign-url-builder
  • Plugin version: 1.8.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.1
  • WordPress version: 6.3.1
  • First release: Aug 26, 2017
  • Latest release: Feb 15, 2023
  • Number of updates: 38
  • Update frequency: every 52.6 days
  • Top authors: reatlat (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

400+ active /8,431 total downloads

Benchmarks

Plugin footprint 65% 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.32MB] [CPU: ▲1.52ms] Passed 4 tests

A check of server-side resources used by Campaign URL Builder
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2941.14 ▲0.85
Dashboard /wp-admin3.66 ▲0.3658.09 ▲9.04
Posts /wp-admin/edit.php3.71 ▲0.3551.23 ▲8.37
Add New Post /wp-admin/post-new.php6.21 ▲0.3290.55 ▼3.30
Media Library /wp-admin/upload.php3.53 ▲0.3138.38 ▲0.17

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 135 new files
Database: 3 new tables, 15 new options
New tables
wp_reatlat_cub_links
wp_reatlat_cub_mediums
wp_reatlat_cub_sources
New WordPress options
reatlat_cub_keep_settings
reatlat_cub_version
reatlat_cub_show_creator
widget_recent-comments
reatlat_cub_metaboxes
reatlat_cub_google_api_key
reatlat_cub_admin_only
reatlat_cub_advanced_api
widget_theysaidso_widget
can_compress_scripts
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Campaign URL Builder
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,836 ▲10113.48 ▼1.161.65 ▲0.0742.96 ▼1.88
Dashboard /wp-admin2,245 ▲575.12 ▼0.73117.85 ▲5.2742.90 ▲1.30
Posts /wp-admin/edit.php2,130 ▲442.41 ▲0.4041.41 ▲4.9531.63 ▲0.16
Add New Post /wp-admin/post-new.php6,404 ▲4,87126.26 ▲3.00876.12 ▲210.2240.04 ▼16.64
Media Library /wp-admin/upload.php1,428 ▲404.54 ▲0.30102.46 ▼0.5242.13 ▼0.46

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie tables detected upon uninstall: 3 tables
    • wp_reatlat_cub_links
    • wp_reatlat_cub_mediums
    • wp_reatlat_cub_sources
  • The uninstall procedure has failed, leaving 15 options in the database
    • reatlat_cub_version
    • reatlat_cub_google_api_key
    • can_compress_scripts
    • widget_recent-comments
    • reatlat_cub_metaboxes
    • reatlat_cub_bitly_api_key
    • reatlat_cub_show_useronly
    • reatlat_cub_admin_only
    • widget_theysaidso_widget
    • reatlat_cub_keep_settings
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Please take a closer look at the following
  • 13× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/campaign-url-builder/admin/views/partial/reatlat_cub-admin-notice-clipboard.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/campaign-url-builder/admin/views/partial/reatlat_cub-admin-links-list.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/campaign-url-builder/admin/views/partial/reatlat_cub-admin-manage.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/campaign-url-builder/admin/views/partial/reatlat_cub-admin-kb.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'reatlat_cub' not found in wp-content/plugins/campaign-url-builder/includes/class-reatlat_cub-activator.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/campaign-url-builder/admin/views/partial/reatlat_cub-admin-shortcode.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/campaign-url-builder/admin/views/partial/reatlat_cub-admin-about.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/campaign-url-builder/admin/views/partial/reatlat_cub-admin-sidebar.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'reatlat_cub' not found in wp-content/plugins/campaign-url-builder/includes/class-reatlat_cub-reset.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/campaign-url-builder/admin/views/partial/reatlat_cub-admin-advanced.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: These screenshots lack descriptions #3, #4, #5, #6 in campaign-url-builder/assets to your readme.txt
  • Requires php: Invalid version format
The official readme.txt might help

campaign-url-builder/reatlat_cub.php 85% from 13 tests

"Campaign URL Builder" version 1.8.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("campaign-url-builder.php" instead of "reatlat_cub.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 194 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin5,419 lines of code in 119 files:
LanguageFilesBlank linesComment linesLines of code
Sass872031832,315
PHP254162212,170
PO File1221276563
JavaScript48095369
CSS2022

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity29.25
▷ Minimum class complexity1.00
▷ Maximum class complexity175.00
Average method complexity4.36
▷ Minimum method complexity1.00
▷ Maximum method complexity52.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods71
▷ Static methods00.00%
▷ Public methods6084.51%
▷ Protected methods00.00%
▷ Private methods1115.49%
Functions5
▷ Named functions240.00%
▷ Anonymous functions360.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 PNG files occupy 0.28MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/views/images/gplv3.png12.30KB8.37KB▼ 31.95%
admin/views/images/github-octcat.png13.36KB6.02KB▼ 54.98%
admin/views/images/opensource.png6.59KB3.80KB▼ 42.40%
admin/views/images/rateus.png181.44KB61.45KB▼ 66.13%
admin/views/images/help-sign.png48.70KB20.26KB▼ 58.39%