83% bw-portfolio

Code Review | BW Portfolio

WordPress plugin BW Portfolio scored83%from 54 tests.

About plugin

  • Plugin page: bw-portfolio
  • Plugin version: 1.2.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.9.3
  • WordPress version: 6.3.1
  • First release: Jan 5, 2022
  • Latest release: May 2, 2022
  • Number of updates: 21
  • Update frequency: every 5.6 days
  • Top authors: bhartlenn (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /2,746 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.08MB] [CPU: ▼4.26ms] Passed 4 tests

Server-side resources used by BW Portfolio
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0942.69 ▲1.61
Dashboard /wp-admin3.38 ▲0.0848.50 ▼4.01
Posts /wp-admin/edit.php3.43 ▲0.0849.05 ▼3.26
Add New Post /wp-admin/post-new.php6.06 ▲0.1895.45 ▼11.39
Media Library /wp-admin/upload.php3.30 ▲0.0738.82 ▲7.10
Portfolio Tags /wp-admin/edit-tags.php?taxonomy=portfolio_tag&post_type=bw_portfolio3.3037.44
Portfolio Items /wp-admin/edit.php?post_type=bw_portfolio3.3535.17
Add New /wp-admin/post-new.php?post_type=bw_portfolio6.0582.02

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for BW Portfolio
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,914 ▲12813.44 ▼0.937.64 ▲5.3941.12 ▼4.80
Dashboard /wp-admin2,226 ▲465.57 ▼0.1091.44 ▼0.2737.92 ▼5.90
Posts /wp-admin/edit.php2,134 ▲341.98 ▲0.0139.61 ▲4.2437.64 ▼1.04
Add New Post /wp-admin/post-new.php1,552 ▲2422.96 ▼0.26659.93 ▲14.6650.89 ▼1.41
Media Library /wp-admin/upload.php1,431 ▲284.09 ▼0.09110.08 ▲0.7047.18 ▲7.59
Portfolio Tags /wp-admin/edit-tags.php?taxonomy=portfolio_tag&post_type=bw_portfolio1,2742.1227.7531.23
Portfolio Items /wp-admin/edit.php?post_type=bw_portfolio1,1231.9832.2128.82
Add New /wp-admin/post-new.php?post_type=bw_portfolio6,22723.35814.1930.53

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bw-portfolio/bw-portfolio.php:33
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/bw-portfolio/inc/portfolio-loop.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Query' not found in wp-content/plugins/bw-portfolio/inc/portfolio-query.php:61
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/bw-portfolio/inc/portfolio-query.php on line 56
    • > PHP Notice
      Undefined variable: bw_portfolio_query in wp-content/plugins/bw-portfolio/inc/portfolio-loop.php on line 6
    • > PHP Notice
      Undefined variable: bw_atts in wp-content/plugins/bw-portfolio/inc/portfolio-query.php on line 56

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: portfolio, modal, grid, shortcode

bw-portfolio/bw-portfolio.php 85% from 13 tests

The main file in "BW Portfolio" v. 1.2.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 411 characters long)
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin718 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP3111121348
JavaScript16450195
CSS12737175

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
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%
Functions11
▷ Named functions981.82%
▷ Anonymous functions218.18%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.54MB with 0.40MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/screenshot-1.png555.41KB145.86KB▼ 73.74%