83% tlp-portfolio

Code Review | Portfolio - WordPress Portfolio Plugin

WordPress plugin Portfolio - WordPress Portfolio Plugin scored83%from 54 tests.

About plugin

  • Plugin page: tlp-portfolio
  • Plugin version: 2.8.15
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-6.4
  • WordPress version: 6.3.1
  • First release: Sep 15, 2015
  • Latest release: Nov 20, 2023
  • Number of updates: 141
  • Update frequency: every 21.2 days
  • Top authors: techlabpro1 (100%)

Code review

54 tests

User reviews

35 reviews

Install metrics

9,000+ active /163,713 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.23MB] [CPU: ▼1.54ms] Passed 4 tests

Server-side resources used by Portfolio - WordPress Portfolio Plugin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.2441.95 ▲1.45
Dashboard /wp-admin3.55 ▲0.2051.39 ▼7.54
Posts /wp-admin/edit.php3.58 ▲0.2352.61 ▼1.16
Add New Post /wp-admin/post-new.php6.14 ▲0.2696.51 ▲1.10
Media Library /wp-admin/upload.php3.47 ▲0.2441.21 ▲8.42
Categories /wp-admin/edit-tags.php?taxonomy=portfolio-category&post_type=portfolio3.4741.98
Tags /wp-admin/edit-tags.php?taxonomy=portfolio-tag&post_type=portfolio3.4745.26
Get Help /wp-admin/edit.php?post_type=portfolio&page=tlp_portfolio_get_help3.4937.45
Settings /wp-admin/edit.php?post_type=portfolio&page=tlp_portfolio_settings3.4944.94
ShortCodes /wp-admin/edit.php?post_type=portfolio-sc3.5141.30
Add Portfolio /wp-admin/post-new.php?post_type=portfolio3.6454.66
All Portfolios /wp-admin/edit.php?post_type=portfolio3.5044.81

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 95 new files
Database: no new tables, 10 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
tpl_portfolio_settings
widget_widget_tlp_port_owl_carousel
db_upgraded
tlp_portfolio_installed_version
widget_recent-comments
rtport_plugin_activation_time

Browser metrics Passed 4 tests

This is an overview of browser requirements for Portfolio - WordPress Portfolio Plugin
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,884 ▲12214.67 ▲0.371.83 ▲0.1941.96 ▼3.19
Dashboard /wp-admin2,281 ▲1125.55 ▼0.2196.14 ▼7.7371.41 ▲28.12
Posts /wp-admin/edit.php2,190 ▲902.15 ▲0.2042.90 ▼1.5835.23 ▼2.25
Add New Post /wp-admin/post-new.php6,355 ▲4,82021.64 ▼3.66922.54 ▲314.2557.48 ▼8.85
Media Library /wp-admin/upload.php1,477 ▲834.14 ▲0.0198.39 ▲3.5471.13 ▲28.42
Categories /wp-admin/edit-tags.php?taxonomy=portfolio-category&post_type=portfolio1,3542.2730.8935.56
Tags /wp-admin/edit-tags.php?taxonomy=portfolio-tag&post_type=portfolio1,3322.2731.1434.43
Get Help /wp-admin/edit.php?post_type=portfolio&page=tlp_portfolio_get_help1,7019.18278.52106.38
Settings /wp-admin/edit.php?post_type=portfolio&page=tlp_portfolio_settings1,1872.5646.3434.44
ShortCodes /wp-admin/edit.php?post_type=portfolio-sc1,2092.4548.2152.20
Add Portfolio /wp-admin/post-new.php?post_type=portfolio3,0438.38202.01141.50
All Portfolios /wp-admin/edit.php?post_type=portfolio1,1751.9333.7836.03

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 10 options
    • widget_widget_tlp_port_owl_carousel
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • rtport_plugin_activation_time
    • tlp_portfolio_installed_version
    • tpl_portfolio_settings
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 43× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/tlp-portfolio/lib/templates/elementor/carousel3.php
    • > /wp-content/plugins/tlp-portfolio/lib/templates/layouts/carousel2.php
    • > /wp-content/plugins/tlp-portfolio/lib/templates/layouts/layout1.php
    • > /wp-content/plugins/tlp-portfolio/lib/classes/TLPPortfolioSCMeta.php
    • > /wp-content/plugins/tlp-portfolio/lib/templates/layouts/layout2.php
    • > /wp-content/plugins/tlp-portfolio/lib/views/help.php
    • > /wp-content/plugins/tlp-portfolio/lib/models/PFProReSizer.php
    • > /wp-content/plugins/tlp-portfolio/lib/models/TlpPortfolioField.php
    • > /wp-content/plugins/tlp-portfolio/lib/templates/layouts/carousel1.php
    • > /wp-content/plugins/tlp-portfolio/lib/templates/elementor/layout1.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% 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
Attributes that need to be fixed:
  • Donate link: Invalid url: ""
  • Tags: Please reduce the number of tags, currently 15 tag instead of maximum 10
The official readme.txt might help

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

The entry point to "Portfolio - WordPress Portfolio Plugin" version 2.8.15 is a PHP file that has certain tags in its header comment area
131 characters long description:
Portfolio is Fully Responsive and Mobile Friendly portfolio for WordPress to display your portfolio work in Grid and Isotope Views.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin9,956 lines of code in 61 files:
LanguageFilesBlank linesComment linesLines of code
PHP431,1946797,145
CSS7424912,370
JavaScript105399426
SVG13015

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 177)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity43.52
▷ Minimum class complexity1.00
▷ Maximum class complexity358.00
Average method complexity5.92
▷ Minimum method complexity1.00
▷ Maximum method complexity177.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes21
▷ Abstract classes00.00%
▷ Concrete classes21100.00%
▷ Final classes00.00%
Methods184
▷ Static methods126.52%
▷ Public methods15182.07%
▷ Protected methods105.43%
▷ Private methods2312.50%
Functions11
▷ Named functions19.09%
▷ Anonymous functions1090.91%
Constants5
▷ Global constants5100.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
21 PNG files occupy 0.08MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/layout/isotope2.png3.08KB1.85KB▼ 40.10%
assets/images/layout/layout1.png2.33KB1.53KB▼ 34.67%
assets/images/tlp-sprite.png8.97KB5.54KB▼ 38.25%
assets/images/old-portfolio.png1.28KB0.46KB▼ 64.00%
assets/images/layout_type_isotope.png1.65KB0.52KB▼ 68.30%