10% post-template-select

Code Review | Post Template Select

WordPress plugin Post Template Select scored10%from 54 tests.

About plugin

  • Plugin page: post-template-select
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-4.8.2
  • WordPress version: 6.3.1
  • First release: Mar 9, 2017
  • Latest release: Nov 5, 2017
  • Number of updates: 8
  • Update frequency: every 29.3 days
  • Top authors: munishsandy (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active /3,507 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/post-template-select/post-template-select.php+45
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.03MB] [CPU: ▼5.53ms] Passed 4 tests

Analyzing server-side resources used by Post Template Select
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0341.50 ▲2.24
Dashboard /wp-admin3.34 ▲0.0447.38 ▼6.56
Posts /wp-admin/edit.php3.40 ▲0.0352.50 ▼2.20
Add New Post /wp-admin/post-new.php5.93 ▲0.0496.05 ▼14.15
Media Library /wp-admin/upload.php3.27 ▲0.0335.65 ▲0.78

Server storage [IO: ▲0.02MB] [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: 3 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
ulm_single_template_options
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Post Template Select: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲4414.28 ▼0.011.82 ▼0.3540.46 ▼1.76
Dashboard /wp-admin2,211 ▲435.61 ▼0.0889.89 ▼1.8042.40 ▲1.43
Posts /wp-admin/edit.php2,116 ▲162.01 ▲0.0046.05 ▲6.4842.18 ▲3.93
Add New Post /wp-admin/post-new.php6,250 ▲4,72219.02 ▼4.17859.82 ▲239.7067.77 ▲16.45
Media Library /wp-admin/upload.php1,416 ▲134.20 ▼0.00106.08 ▼0.0544.66 ▼2.29

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • ulm_single_template_options
    • widget_recent-posts

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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/post-template-select/post-template-select.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
The official readme.txt might help

post-template-select/post-template-select.php Passed 13 tests

The entry point to "Post Template Select" version 1.3 is a PHP file that has certain tags in its header comment area
45 characters long description:
Use templates in Posts and Custom Post Types.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected285 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP21543285

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity32.00
▷ Minimum class complexity32.00
▷ Maximum class complexity32.00
Average method complexity3.82
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.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

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