94% portfolio-cpt

Code Review | Portfolio CPT

WordPress plugin Portfolio CPT scored 94% from 54 tests.

About plugin

  • Plugin page: portfolio-cpt
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9
  • WordPress version: 5.8.1
  • First release: Aug 30, 2018
  • Latest release: Aug 30, 2018
  • Number of updates: 2
  • Update frequency: every 3.5 days
  • Top authors: DannyCooper (100%)

Code review

54 tests

User reviews

1 review

Install metrics

800+ active / 2,795 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼143.42ms] Passed 4 tests

This is a short check of server-side resources used by Portfolio CPT
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.92 ▲0.2035.39 ▲11.26
Dashboard /wp-admin3.14 ▲0.0849.53 ▲3.73
Posts /wp-admin/edit.php3.20 ▲0.0950.72 ▲5.40
Add New Post /wp-admin/post-new.php5.49 ▲0.0688.20 ▼582.79
Media Library /wp-admin/upload.php3.08 ▲0.0833.16 ▼0.03
Add New /wp-admin/post-new.php?post_type=portfolio3.1946.78
All Items /wp-admin/edit.php?post_type=portfolio3.1333.85
Tags /wp-admin/edit-tags.php?taxonomy=portfolio_tag&post_type=portfolio3.0828.84

Server storage [IO: ▲0.02MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 7 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Portfolio CPT
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,725 ▲15315.99 ▲0.3511.92 ▲1.9146.64 ▼7.30
Dashboard /wp-admin3,007 ▲765.92 ▼0.23145.60 ▼7.48108.30 ▼0.89
Posts /wp-admin/edit.php2,779 ▲402.72 ▲0.0165.88 ▼8.8792.01 ▲4.18
Add New Post /wp-admin/post-new.php1,709 ▲2618.75 ▲0.33405.94 ▼12.12111.62 ▲2.82
Media Library /wp-admin/upload.php1,847 ▲405.02 ▼0.01143.98 ▼5.46109.16 ▼7.12
Add New /wp-admin/post-new.php?post_type=portfolio3,1169.13235.02146.64
All Items /wp-admin/edit.php?post_type=portfolio1,4702.6461.0271.87
Tags /wp-admin/edit-tags.php?taxonomy=portfolio_tag&post_type=portfolio1,7512.4059.3081.17

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled completely, with no zombie files or tables

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
Good news, no errors were detected

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 fix the following
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/portfolio-cpt/portfolio-cpt.php:43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/portfolio-cpt/includes/register-taxonomy.php:47
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/portfolio-cpt/includes/class-portfolio-cpt-permalink.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/portfolio-cpt/includes/register-cpt.php:59
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/portfolio-cpt/includes/register-shortcode.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #1 (Knowledge Base permalink setting), #2 (Articles Widget)
The official readme.txt is a good inspiration

portfolio-cpt/portfolio-cpt.php 92% from 13 tests

The principal PHP file in "Portfolio CPT" v. 1.0.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Domain Path: The domain path folder was not found ("/languages")

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
Success! There were no dangerous files found in this plugin326 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP567103198
CSS12615128

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity3.50
▷ Minimum class complexity1.00
▷ Maximum class complexity6.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods110.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.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
There were not PNG files found in your plugin