83% which-template-file

Code Review | which template file

WordPress plugin which template file scored83%from 54 tests.

About plugin

  • Plugin page: which-template-file
  • Plugin version: 4.9.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.0-6.3.2
  • WordPress version: 6.3.1
  • First release: Oct 21, 2013
  • Latest release: Oct 17, 2023
  • Number of updates: 54
  • Update frequency: every 67.7 days
  • Top authors: gilles66 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

4,000+ active /32,169 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼6.24ms] Passed 4 tests

This is a short check of server-side resources used by which template file
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.58 ▼0.26
Dashboard /wp-admin3.32 ▲0.0146.08 ▼7.29
Posts /wp-admin/edit.php3.37 ▲0.0143.79 ▼13.14
Add New Post /wp-admin/post-new.php5.90 ▲0.0181.40 ▼4.25
Media Library /wp-admin/upload.php3.24 ▲0.0133.94 ▲1.37

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by which template file
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲6614.34 ▼0.271.96 ▲0.4442.56 ▼1.22
Dashboard /wp-admin2,195 ▲155.57 ▼0.0982.49 ▼1.2939.09 ▼4.04
Posts /wp-admin/edit.php2,100 ▼01.99 ▼0.0334.40 ▼6.1830.97 ▼6.79
Add New Post /wp-admin/post-new.php1,526 ▼223.72 ▲0.59679.99 ▲14.6456.06 ▼7.55
Media Library /wp-admin/upload.php1,403 ▲94.20 ▲0.0397.16 ▲1.0942.64 ▲3.39

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: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts

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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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 take a closer look at the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'class_page_admin' not found in wp-content/plugins/which-template-file/admin/add_menu_page.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/which-template-file/which-template-file.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Screenshots: Screenshot #1 (The template used owns to a plugin) image missing
The official readme.txt might help

which-template-file/which-template-file.php 92% from 13 tests

The main PHP script in "which template file" version 4.9.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 373 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected231 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP349130231

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.26
Average class complexity6.50
▷ Minimum class complexity5.00
▷ Maximum class complexity8.00
Average method complexity1.73
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes150.00%
▷ Concrete classes150.00%
▷ Final classes00.00%
Methods15
▷ Static methods16.67%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
7 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png0.75KB0.71KB▼ 5.32%
screenshot-3.png1.65KB1.59KB▼ 3.38%
(invalid) icon-128x128.png5.28KB0.00KB▼ 100.00%
(invalid) icon-256x256.png11.36KB0.00KB▼ 100.00%
screenshot-2.png1.44KB1.49KB0.00%