84% portfolio-pro

Code Review | Portfolio - Filterable Masonry Portfolio Gallery for Professionals

WordPress plugin Portfolio - Filterable Masonry Portfolio Gallery for Professionals scored 84% from 54 tests.

About plugin

  • Plugin page: portfolio-pro
  • Plugin version: 1.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1.0-5.6
  • WordPress version: 5.8.1
  • First release: Jul 13, 2016
  • Latest release: Jan 14, 2021
  • Number of updates: 59
  • Update frequency: every 28.1 days
  • Top authors: LogicHunt (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

700+ active / 17,746 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.12MB] [CPU: ▼139.73ms] 75% from 4 tests

Analyzing server-side resources used by Portfolio - Filterable Masonry Portfolio Gallery for Professionals
It is recommended to improve the following
  • CPU: Total CPU usage must kept under 500.00ms (currently 10,614.37ms on /wp-admin/edit.php?post_type=portfoliopro&page=portfolioprosettings)
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.1734.86 ▲10.68
Dashboard /wp-admin3.23 ▲0.1743.12 ▼4.05
Posts /wp-admin/edit.php3.28 ▲0.1752.43 ▲6.88
Add New Post /wp-admin/post-new.php5.50 ▲0.0793.48 ▼560.91
Media Library /wp-admin/upload.php3.09 ▲0.0833.31 ▼0.83
Tags /wp-admin/edit-tags.php?taxonomy=portfolioprotag&post_type=portfoliopro3.1135.69
Categories /wp-admin/edit-tags.php?taxonomy=portfolioprocat&post_type=portfoliopro3.1137.69
Add Item /wp-admin/post-new.php?post_type=portfoliopro3.2052.50
All Item /wp-admin/edit.php?post_type=portfoliopro3.1638.97
Portfolio Settings /wp-admin/edit.php?post_type=portfoliopro&page=portfolioprosettings3.9310,614.37

Server storage [IO: ▲0.34MB] [DB: ▲0.09MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 33 new files
Database: no new tables, 1 new option
New WordPress options
portfoliopro_basic

Browser metrics Passed 4 tests

Portfolio - Filterable Masonry Portfolio Gallery for Professionals: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,064 ▲48218.14 ▲2.1915.41 ▲7.2846.56 ▼2.55
Dashboard /wp-admin3,235 ▲3018.24 ▲2.27175.25 ▲24.12115.31 ▲8.73
Posts /wp-admin/edit.php3,036 ▲2974.37 ▲1.67100.27 ▲29.3794.60 ▲3.42
Add New Post /wp-admin/post-new.php1,666 ▼1721.20 ▲2.50280.07 ▼116.53103.55 ▼11.19
Media Library /wp-admin/upload.php1,882 ▲1344.94 ▼0.06124.96 ▼30.39128.80 ▲13.59
Tags /wp-admin/edit-tags.php?taxonomy=portfolioprotag&post_type=portfoliopro2,0124.2582.2675.65
Categories /wp-admin/edit-tags.php?taxonomy=portfolioprocat&post_type=portfoliopro2,0584.3286.1580.11
Add Item /wp-admin/post-new.php?post_type=portfoliopro3,3759.42251.00135.56
All Item /wp-admin/edit.php?post_type=portfoliopro1,7094.2993.2975.88
Portfolio Settings /wp-admin/edit.php?post_type=portfoliopro&page=portfolioprosettings1,9424.1686.5794.47

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 1 option
    • portfoliopro_basic

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/portfolio-pro/public/partials/portfolio-pro-public-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 15 tag instead of maximum 10
The official readme.txt is a good inspiration

portfolio-pro/portfolio-pro.php Passed 13 tests

The primary PHP file in "Portfolio - Filterable Masonry Portfolio Gallery for Professionals" version 1.2.2 is used by WordPress to initiate all plugin functionality
107 characters long description:
Smart Portfolio Gallery for Professionals. Responsive Grid system with Filter and Masonry Based on Isotope.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin5,405 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript81,0461,2813,666
PHP145028901,096
LESS1325335
CSS3010308

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity14.12
▷ Minimum class complexity1.00
▷ Maximum class complexity54.00
Average method complexity2.32
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods70
▷ Static methods22.86%
▷ Public methods6592.86%
▷ Protected methods00.00%
▷ Private methods57.14%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
public/img/website.png2.26KB2.18KB▼ 3.75%