84% themify-portfolio-post

Code Review | Themify Portfolio Post

WordPress plugin Themify Portfolio Post scored84%from 54 tests.

About plugin

  • Plugin page: themify-portfolio...
  • Plugin version: 1.2.6
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.2.3
  • WordPress version: 6.3.1
  • First release: May 11, 2018
  • Latest release: Nov 4, 2023
  • Number of updates: 115
  • Update frequency: every 18.5 days
  • Top authors: themifyme (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40,000+ active /487,090 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.78MB] [CPU: ▲0.92ms] Passed 4 tests

An overview of server-side resources used by Themify Portfolio Post
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.23 ▲0.7740.96 ▼1.52
Dashboard /wp-admin4.12 ▲0.8150.71 ▲3.11
Posts /wp-admin/edit.php4.17 ▲0.8252.51 ▲5.60
Add New Post /wp-admin/post-new.php6.68 ▲0.7987.31 ▼2.52
Media Library /wp-admin/upload.php3.98 ▲0.7539.32 ▲4.62
Portfolios /wp-admin/edit.php?post_type=portfolio4.1239.70
Add New /wp-admin/post-new.php?post_type=portfolio4.1955.79
Portfolio Categories /wp-admin/edit-tags.php?taxonomy=portfolio-category&post_type=portfolio4.0645.18

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 79 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
__portfolio_slug
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Themify Portfolio Post
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲6214.26 ▼0.451.63 ▼0.1439.08 ▼4.16
Dashboard /wp-admin2,229 ▲515.60 ▼0.0492.14 ▼24.5739.90 ▼7.26
Posts /wp-admin/edit.php2,131 ▲311.99 ▲0.0539.72 ▲1.4035.67 ▼2.44
Add New Post /wp-admin/post-new.php6,266 ▲4,74025.90 ▲2.80917.50 ▲190.6637.33 ▼12.41
Media Library /wp-admin/upload.php1,434 ▲344.23 ▲0.0395.20 ▼10.2840.36 ▼6.66
Portfolios /wp-admin/edit.php?post_type=portfolio1,1181.9637.5231.96
Add New /wp-admin/post-new.php?post_type=portfolio2,6388.12189.1677.19
Portfolio Categories /wp-admin/edit-tags.php?taxonomy=portfolio-category&post_type=portfolio1,4963.3946.0128.79

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • db_upgraded
    • __portfolio_slug
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

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)
Everything seems fine, however this is by no means 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 take a closer look at the following
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/themify-portfolio-post/templates/default.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/themify-portfolio-post/includes/config.php:7
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/themify-portfolio-post/templates/shortcode.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
4 plugin tags: post-type, portfolio, showcase, post

themify-portfolio-post/themify-portfolio-post.php 92% from 13 tests

The main PHP file in "Themify Portfolio Post" ver. 1.2.6 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

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
Good job! No executable or dangerous file extensions detected7,083 lines of code in 43 files:
LanguageFilesBlank linesComment linesLines of code
PHP155197293,313
JavaScript173102512,205
CSS1121411,565

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity59.00
▷ Minimum class complexity13.00
▷ Maximum class complexity172.00
Average method complexity4.92
▷ Minimum method complexity1.00
▷ Maximum method complexity54.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods74
▷ Static methods45.41%
▷ Public methods7195.95%
▷ Protected methods00.00%
▷ Private methods34.05%
Functions66
▷ Named functions6598.48%
▷ Anonymous functions11.52%
Constants8
▷ Global constants8100.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
5 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/themify-metabox/img/ddbtn-cross.png0.18KB0.27KB0.00%
includes/themify-metabox/img/ddbtn-blank.png0.07KB0.09KB0.00%
includes/themify-metabox/img/ddbtn-check.png0.14KB0.23KB0.00%
includes/themify-metabox/img/icon-delete.png0.45KB0.46KB0.00%
includes/themify-metabox/img/jquery.minicolors.png24.58KB27.69KB0.00%