78% custom-post-type-generator

Code Review | Custom Post Type Generator

WordPress plugin Custom Post Type Generator scored 78% from 54 tests.

About plugin

  • Plugin page: custom-post-type-...
  • Plugin version: 2.4.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.0-5.1.1
  • WordPress version: 5.8.1
  • First release: Feb 22, 2013
  • Latest release: Mar 14, 2019
  • Number of updates: 49
  • Update frequency: every 45.1 days
  • Top authors: hijiri (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

2,000+ active / 23,424 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.10MB] [CPU: ▼153.54ms] Passed 4 tests

Server-side resources used by Custom Post Type Generator
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.92 ▲0.2035.57 ▲14.96
Dashboard /wp-admin3.15 ▲0.1047.76 ▲3.29
Posts /wp-admin/edit.php3.24 ▲0.1345.66 ▲1.84
Add New Post /wp-admin/post-new.php5.51 ▲0.0890.15 ▼620.06
Media Library /wp-admin/upload.php3.10 ▲0.1034.99 ▲0.78
Custom Post Type /wp-admin/admin.php?page=cptg-manage-cpt3.1131.81
Custom Taxonomy /wp-admin/admin.php?page=cptg-manage-tax3.1134.05
Add New /wp-admin/admin.php?page=cptg-regist-tax3.1832.86
Add New /wp-admin/admin.php?page=cptg-regist-cpt3.2831.27
Export /wp-admin/admin.php?page=cptg-export3.3234.92

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 1 new option
New WordPress options
cptg_activation

Browser metrics Passed 4 tests

A check of browser resources used by Custom Post Type Generator
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,742 ▲14615.99 ▲0.0111.51 ▲1.0748.54 ▲0.98
Dashboard /wp-admin3,028 ▲946.00 ▼0.09135.47 ▼6.28110.91 ▼1.81
Posts /wp-admin/edit.php2,778 ▲392.73 ▲0.0165.17 ▼3.39100.08 ▲4.09
Add New Post /wp-admin/post-new.php1,897 ▲2519.21 ▲0.07390.85 ▲28.21111.37 ▲7.19
Media Library /wp-admin/upload.php1,849 ▲425.06 ▲0.01152.72 ▲14.41113.94 ▼12.16
Custom Post Type /wp-admin/admin.php?page=cptg-manage-cpt1,4092.6863.0372.34
Custom Taxonomy /wp-admin/admin.php?page=cptg-manage-tax1,3772.3956.4771.72
Add New /wp-admin/admin.php?page=cptg-regist-tax2,0462.4257.7384.74
Add New /wp-admin/admin.php?page=cptg-regist-cpt2,2292.4161.6487.81
Export /wp-admin/admin.php?page=cptg-export1,1662.5061.0086.48

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 1 option
    • cptg_activation

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=cptg-export
    • > User deprecated in wp-includes/functions.php+5221
    screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/admin.php?page=cptg-export
    • > User deprecated in wp-includes/functions.php+5221
    get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
  • 9× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/custom-post-type-generator/include/regist_tax.php:13
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/custom-post-type-generator/include/export.php:14
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/custom-post-type-generator/include/manage_tax.php:21
    • > PHP Notice
      Trying to get property 'options' of non-object in wp-content/plugins/custom-post-type-generator/include/manage_tax.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/custom-post-type-generator/include/regist_cpt.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/custom-post-type-generator/custom-post-type-generator.php:17
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/custom-post-type-generator/include/manage_cpt.php:21
    • > PHP Notice
      Trying to get property 'options' of non-object in wp-content/plugins/custom-post-type-generator/include/export.php on line 9
    • > PHP Notice
      Trying to get property 'options' of non-object in wp-content/plugins/custom-post-type-generator/include/manage_cpt.php on line 14

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
2 plugin tags: custom post type, custom taxonomy

custom-post-type-generator/custom-post-type-generator.php 92% from 13 tests

Analyzing the main PHP file in "Custom Post Type Generator" version 2.4.2
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 157 characters long)

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 plugin2,224 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP6229501,750
PO File1169339334
JavaScript1218100
CSS14026
Markdown19014

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity92.00
▷ Minimum class complexity92.00
▷ Maximum class complexity92.00
Average method complexity5.79
▷ Minimum method complexity1.00
▷ Maximum method complexity54.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin