79% simple-cpt

Code Review | Simple CPT

WordPress plugin Simple CPT scored79%from 54 tests.

About plugin

  • Plugin page: simple-cpt
  • Plugin version: 1.0.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Apr 8, 2021
  • Latest release: Oct 11, 2023
  • Number of updates: 12
  • Update frequency: every 76.4 days
  • Top authors: pattihis (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

400+ active /2,694 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.26MB] [CPU: ▼1.37ms] Passed 4 tests

Analyzing server-side resources used by Simple CPT
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2542.43 ▲3.22
Dashboard /wp-admin3.55 ▲0.2549.30 ▲2.40
Posts /wp-admin/edit.php3.67 ▲0.3147.20 ▲0.74
Add New Post /wp-admin/post-new.php6.16 ▲0.2785.51 ▼9.48
Media Library /wp-admin/upload.php3.48 ▲0.2538.52 ▲0.88
Overview /wp-admin/admin.php?page=simple-cpt3.5035.50
Post Types /wp-admin/edit.php?post_type=simple_cpt3.5241.23
Taxonomies /wp-admin/edit.php?post_type=simple_tax3.5237.28

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Simple CPT: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,940 ▲17913.52 ▼0.848.30 ▲6.7044.33 ▲3.02
Dashboard /wp-admin2,229 ▲585.60 ▲0.0295.02 ▲7.0245.04 ▲7.10
Posts /wp-admin/edit.php2,137 ▲371.98 ▼0.0237.08 ▲1.0532.46 ▼3.70
Add New Post /wp-admin/post-new.php1,560 ▲3223.02 ▼0.14655.85 ▼17.5365.94 ▲11.27
Media Library /wp-admin/upload.php1,440 ▲404.18 ▼0.0395.11 ▼9.4141.74 ▼2.68
Overview /wp-admin/admin.php?page=simple-cpt9921.9923.6741.94
Post Types /wp-admin/edit.php?post_type=simple_cpt1,1791.9531.8145.19
Taxonomies /wp-admin/edit.php?post_type=simple_tax1,1641.9635.2832.03

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% 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 0% 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
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/simple-cpt/public/partials/simple-cpt-public-display.php
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/simple-cpt/admin/partials/simple-cpt-metabox-tax.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/simple-cpt/admin/partials/simple-cpt-metabox-cpt.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Query' not found in wp-content/plugins/simple-cpt/admin/partials/simple-cpt-admin-display.php:19
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/simple-cpt/admin/partials/simple-cpt-admin-footer.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: custom post type, cpt, simple cpt, taxonomies

simple-cpt/simple-cpt.php Passed 13 tests

This is the main PHP file of "Simple CPT" version 1.0.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
114 characters long description:
Simple CPT provides an easy to use interface for registering and managing Custom Post Types and Custom Taxonomies.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin1,427 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP152596621,276
CSS204132
JavaScript282719

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity29.71
▷ Minimum class complexity1.00
▷ Maximum class complexity198.00
Average method complexity5.57
▷ Minimum method complexity1.00
▷ Maximum method complexity82.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods44
▷ Static methods24.55%
▷ Public methods3988.64%
▷ Protected methods00.00%
▷ Private methods511.36%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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