84% cpo-companion

Code Review | CPO Companion

WordPress plugin CPO Companion scored84%from 54 tests.

About plugin

  • Plugin page: cpo-companion
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-6.1
  • WordPress version: 6.3.1
  • First release: Jan 23, 2018
  • Latest release: Jan 5, 2023
  • Number of updates: 22
  • Update frequency: every 82.4 days
  • Top authors: machothemes (59.09%)giucu91 (31.82%)wpchill (13.64%)cpothemes (9.09%)

Code review

54 tests

User reviews

1 review

Install metrics

9,000+ active /119,568 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.29MB] [CPU: ▼5.90ms] Passed 4 tests

A check of server-side resources used by CPO Companion
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2740.62 ▼6.60
Dashboard /wp-admin3.60 ▲0.2951.15 ▼10.02
Posts /wp-admin/edit.php3.71 ▲0.3553.75 ▲3.62
Add New Post /wp-admin/post-new.php6.18 ▲0.2990.32 ▼10.60
Media Library /wp-admin/upload.php3.52 ▲0.2941.28 ▲4.17
CPO Settings /wp-admin/options-general.php?page=cpo_companion_settings3.4836.88

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 87 new files
Database: no new tables, 13 new options
New WordPress options
widget_ctwg-recent-posts
can_compress_scripts
widget_recent-posts
widget_ctwg-social
db_upgraded
widget_recent-comments
widget_ctwg-author
widget_ctwg-flickr
widget_theysaidso_widget
widget_ctwg-advert
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for CPO Companion
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲4114.24 ▼0.021.51 ▼0.2141.40 ▼5.74
Dashboard /wp-admin2,207 ▲305.68 ▲0.0585.14 ▼9.6239.22 ▼0.73
Posts /wp-admin/edit.php2,109 ▲91.95 ▼0.0839.76 ▲0.5639.24 ▼2.08
Add New Post /wp-admin/post-new.php1,534 ▲323.04 ▼0.02693.83 ▲10.2269.53 ▲18.61
Media Library /wp-admin/upload.php1,409 ▲94.17 ▼0.0697.04 ▼12.2342.45 ▼2.19
CPO Settings /wp-admin/options-general.php?page=cpo_companion_settings9732.0023.2128.22

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 13 options
    • widget_recent-comments
    • widget_ctwg-recent-posts
    • widget_ctwg-instagram
    • widget_ctwg-advert
    • widget_ctwg-twitter-stream
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_ctwg-social
    • ...

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 items
  • 51× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/cpo-companion/includes/shortcodes/shortcode-dropcap.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/cpo-companion/includes/shortcodes/shortcode-tabs.php:40
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cpo-companion/includes/cposts/cpost-clients.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/cpo-companion/includes/shortcodes/shortcode-list.php:62
    • > PHP Fatal error
      require_once(): Failed opening required 'CPO_COMPANION_PATHincludes/cposts/cpost-slides.php' (include_path='.:/usr/share/php') in wp-content/plugins/cpo-companion/includes/class-cpo-custom-posts-types.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/cpo-companion/includes/shortcodes/shortcode-counter.php:56
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/cpo-companion/includes/shortcodes/shortcode-posts.php:130
    • > PHP Warning
      require_once(CPO_COMPANION_PATHincludes/widgets/class-cpo-widget-advert.php): failed to open stream: No such file or directory in wp-content/plugins/cpo-companion/includes/class-cpo-widgets.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/cpo-companion/includes/shortcodes/shortcode-column.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/cpo-companion/includes/widgets/class-cpo-widget-flickr.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Manage post types from the admin panel.), #2 (Quick Insert button for immediate markup), #3 (Multiple button sizes and colors. Choose from a predefined palette or a custom HEX color), #4 (Add message boxes, notifications, and highlighted boxes with custom background colors), #5 (Create testimonials, team members, or inline features), #6 (Add custom-colored pricing tables to your pages), #7 (Display your most recent posts with a more stylish design), #8 (Insert images into your sidebars without having to code HTML), #9 (Add your latest tweets without cumbersome setting pages), #10 (Show the latest Flickr photos from a Flirck account), #11 (Display a list of links to your social profiles)
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
You can take inspiration from this readme.txt

cpo-companion/cpo-companion.php Passed 13 tests

Analyzing the main PHP file in "CPO Companion" version 1.1.0
90 characters long description:
Creates Post Types, Shortcodes and Widgets in order to create a powerful business website.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin29,193 lines of code in 73 files:
LanguageFilesBlank linesComment linesLines of code
XML57098020,448
PHP579947895,703
JavaScript648531,944
SVG200587
CSS310197511

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity16.70
▷ Minimum class complexity1.00
▷ Maximum class complexity149.00
Average method complexity3.66
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes30
▷ Abstract classes26.67%
▷ Concrete classes2893.33%
▷ Final classes00.00%
Methods181
▷ Static methods116.08%
▷ Public methods15887.29%
▷ Protected methods31.66%
▷ Private methods2011.05%
Functions78
▷ Named functions78100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon-shortcodes.png0.89KB0.97KB0.00%