77% wp-post-type-template

Code Review | WP Post Type Template

WordPress plugin WP Post Type Template scored77%from 54 tests.

About plugin

  • Plugin page: wp-post-type-temp...
  • Plugin version: 1.0.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.8.1
  • WordPress version: 6.3.1
  • First release: Jul 13, 2016
  • Latest release: Sep 23, 2021
  • Number of updates: 11
  • Update frequency: every 172.6 days
  • Top authors: mithublue (100%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active /5,280 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▼0.64MB] [CPU: ▼16.10ms] 75% from 4 tests

A check of server-side resources used by WP Post Type Template
Please fix the following
  • CPU: Try to keep total CPU usage under 500.00ms (currently 677.73ms on /wp-admin/admin.php?page=cc-product-page)
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0636.23 ▼2.56
Dashboard /wp-admin3.36 ▲0.0150.53 ▼6.94
Posts /wp-admin/edit.php3.42 ▲0.061,370.01 ▲1,324.30
Add New Post /wp-admin/post-new.php3.21 ▼2.6835.54 ▼60.16
Media Library /wp-admin/upload.php3.29 ▲0.0536.57 ▲5.28
News /wp-admin/admin.php?page=wp-post-type-template/news.php3.27990.97
Cybercraft Products /wp-admin/admin.php?page=cc-product-page3.61677.73

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

WP Post Type Template: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,850 ▲8914.28 ▲0.001.82 ▲0.2844.80 ▲3.71
Dashboard /wp-admin2,228 ▲565.62 ▲0.0294.01 ▼3.8843.25 ▲2.99
Posts /wp-admin/edit.php2,136 ▲392.02 ▲0.0533.92 ▼0.4334.75 ▼3.97
Add New Post /wp-admin/post-new.php6,269 ▲4,74326.06 ▲2.48921.08 ▲315.8963.06 ▲11.44
Media Library /wp-admin/upload.php1,439 ▲394.16 ▼0.0595.56 ▲1.8441.86 ▼1.30
News /wp-admin/admin.php?page=wp-post-type-template/news.php7922.0223.7222.19
Cybercraft Products /wp-admin/admin.php?page=cc-product-page1,1722.0025.0326.77

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=wp-post-type-template/news.php
    • > Notice in wp-content/plugins/wp-post-type-template/news.php+104
    Trying to access array offset on value of type null
  • 42 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cc-product-page
    • > Notice in wp-content/plugins/wp-post-type-template/cc-products-page.php+33
    Trying to get property 'slug' of non-object
  • 21 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cc-product-page
    • > Notice in wp-content/plugins/wp-post-type-template/cc-products-page.php+31
    Trying to get property 'name' of non-object
  • 21 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cc-product-page
    • > Notice in wp-content/plugins/wp-post-type-template/cc-products-page.php+32
    Trying to get property 'short_description' of non-object

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
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-post-type-template/wp-post-template.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-post-type-template/cc-products-page.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-post-type-template/news.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Donate link: Invalid URI ("")
  • Tags: Too many tags (26 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

wp-post-type-template/wp-post-template.php 92% from 13 tests

The main PHP script in "WP Post Type Template" version 1.0.3.1 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-post-type-template.php" instead of "wp-post-template.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected293 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP35225291
Markdown1002

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity12.67
▷ Minimum class complexity5.00
▷ Maximum class complexity21.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods20
▷ Static methods420.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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 are no PNG files in this plugin