94% portfolio-post-type

Code Review | Portfolio Post Type

WordPress plugin Portfolio Post Type scored 94% from 53 tests.

About plugin

  • Plugin page: portfolio-post-type
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.5
  • WordPress version: 5.8.1
  • First release: Aug 26, 2011
  • Latest release: Aug 29, 2020
  • Number of updates: 35
  • Update frequency: every 94.0 days
  • Top authors: downstairsdev (100%)

Code review

53 tests

User reviews

14 reviews

Install metrics

100,000+ active / 784,308 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.19MB] [CPU: ▼274.10ms] Passed 4 tests

This is a short check of server-side resources used by Portfolio Post Type
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.98 ▲0.1435.30 ▼0.55
Dashboard /wp-admin3.28 ▲0.2344.56 ▲0.22
Posts /wp-admin/edit.php3.34 ▲0.2442.81 ▼1.41
Add New Post /wp-admin/post-new.php5.80 ▲0.3795.43 ▼1,086.54
Media Library /wp-admin/upload.php3.16 ▲0.1636.53 ▼7.89
Portfolio Categories /wp-admin/edit-tags.php?taxonomy=portfolio_category&post_type=portfolio3.1635.72
Portfolio Tags /wp-admin/edit-tags.php?taxonomy=portfolio_tag&post_type=portfolio3.1634.47
All Portfolio Items /wp-admin/edit.php?post_type=portfolio3.2232.11
Add New Item /wp-admin/post-new.php?post_type=portfolio5.8090.98

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 18 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Portfolio Post Type
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,725 ▲11915.80 ▼0.127.55 ▼2.4646.75 ▲3.18
Dashboard /wp-admin2,975 ▲1226.05 ▲0.19142.18 ▲4.9698.79 ▲0.52
Posts /wp-admin/edit.php2,748 ▲422.70 ▲0.0266.11 ▼5.1786.25 ▲0.04
Add New Post /wp-admin/post-new.php1,510 ▼14618.49 ▲0.31372.81 ▼26.09109.84 ▲5.24
Media Library /wp-admin/upload.php1,820 ▲485.02 ▼0.00145.45 ▼28.58103.12 ▼13.25
Portfolio Categories /wp-admin/edit-tags.php?taxonomy=portfolio_category&post_type=portfolio1,7492.5162.4260.44
Portfolio Tags /wp-admin/edit-tags.php?taxonomy=portfolio_tag&post_type=portfolio1,7212.4960.6561.81
All Portfolio Items /wp-admin/edit.php?post_type=portfolio1,4922.6361.8757.69
Add New Item /wp-admin/post-new.php?post_type=portfolio5,67816.55473.11104.47

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 shallow check for server-side errors
Even though everything seems fine, this is not 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 fix the following items
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'Gamajo_Post_Type' not found in wp-content/plugins/portfolio-post-type/includes/class-portfolio-post-type-post-type.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Gamajo_Taxonomy' not found in wp-content/plugins/portfolio-post-type/includes/class-portfolio-post-type-taxonomy-category.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Gamajo_Registerable' not found in wp-content/plugins/portfolio-post-type/includes/class-gamajo-post-type.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Gamajo_Taxonomy' not found in wp-content/plugins/portfolio-post-type/includes/class-portfolio-post-type-taxonomy-tag.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Gamajo_Registerable' not found in wp-content/plugins/portfolio-post-type/includes/class-gamajo-taxonomy.php:19

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
2 plugin tags: post type, portfolio

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

The primary PHP file in "Portfolio Post Type" version 1.0.1 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected825 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP12135683566
PO File2108116259

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity5.27
▷ Minimum class complexity1.00
▷ Maximum class complexity13.00
Average method complexity1.98
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes10
▷ Abstract classes220.00%
▷ Concrete classes880.00%
▷ Final classes00.00%
Methods55
▷ Static methods00.00%
▷ Public methods3767.27%
▷ Protected methods1527.27%
▷ Private methods35.45%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 1 test

Image compression Passed 1 test

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin