62% companion-portfolio

Code Review | Companion Portfolio - Responsive Portfolio Plugin

WordPress plugin Companion Portfolio - Responsive Portfolio Plugin scored62%from 54 tests.

About plugin

  • Plugin page: companion-portfolio
  • Plugin version: 2.4.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-6.2
  • WordPress version: 6.3.1
  • First release: May 11, 2016
  • Latest release: Mar 31, 2023
  • Number of updates: 81
  • Update frequency: every 31.1 days
  • Top authors: Papin (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

80+ active /5,661 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼1.57MB] [CPU: ▼45.47ms] Passed 4 tests

An overview of server-side resources used by Companion Portfolio - Responsive Portfolio Plugin
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.43 ▼1.0411.06 ▼28.70
Dashboard /wp-admin2.44 ▼0.9014.58 ▼45.88
Posts /wp-admin/edit.php2.44 ▼0.9114.32 ▼28.01
Add New Post /wp-admin/post-new.php2.44 ▼3.4513.54 ▼79.30
Media Library /wp-admin/upload.php2.44 ▼0.7914.33 ▼18.83
Categories /wp-admin/edit-tags.php?taxonomy=portfolio_cat&post_type=portfolio2.4415.42
Tags /wp-admin/edit-tags.php?taxonomy=portfolio_tag&post_type=portfolio2.4416.14
New item /wp-admin/post-new.php?post_type=portfolio2.4413.39
All items /wp-admin/edit.php?post_type=portfolio2.4415.61

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
portfolio_cat_children
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Companion Portfolio - Responsive Portfolio Plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲5814.14 ▼0.391.75 ▼0.0543.23 ▲0.81
Dashboard /wp-admin2,233 ▲595.59 ▲0.0286.76 ▲1.2840.68 ▼3.72
Posts /wp-admin/edit.php2,135 ▲351.98 ▲0.0235.99 ▲1.5432.57 ▼5.89
Add New Post /wp-admin/post-new.php1,709 ▲18323.84 ▲0.56655.00 ▼7.5958.14 ▲8.13
Media Library /wp-admin/upload.php1,438 ▲384.18 ▲0.04111.69 ▲7.4048.54 ▲5.90
Categories /wp-admin/edit-tags.php?taxonomy=portfolio_cat&post_type=portfolio1,4132.1232.1433.90
Tags /wp-admin/edit-tags.php?taxonomy=portfolio_tag&post_type=portfolio1,2782.1226.8730.77
New item /wp-admin/post-new.php?post_type=portfolio6,25721.40866.3831.55
All items /wp-admin/edit.php?post_type=portfolio1,1321.9630.8627.93

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/companion-portfolio/companion_portfolio.php+87
    Undefined variable: slug
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • portfolio_cat_children
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 26 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=portfolio
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/companion-portfolio/companion_portfolio.php+87
    Undefined variable: slug
    • > GET request to /wp-admin/post-new.php?post_type=portfolio
    • > Notice in wp-includes/post.php+5292
    Object of class WP_Term could not be converted to int

SRP 0% 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
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/companion-portfolio/companion_portfolio.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/companion-portfolio/cp_gutenberg.php:46

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 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
Please fix the following attributes:
  • Screenshots: Screenshot #5 (Add a shortcode to your page using the generator popup.) image required
  • Tags: You are using too many tags: 17 tag instead of maximum 10
You can look at the official readme.txt

companion-portfolio/companion_portfolio.php 92% from 13 tests

The principal PHP file in "Companion Portfolio - Responsive Portfolio Plugin" v. 2.4.0.1 is loaded by WordPress automatically on each request
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 ("companion-portfolio.php" instead of "companion_portfolio.php")

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
Good job! No executable or dangerous file extensions detected723 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP210675334
CSS1104214
JavaScript12210175

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin