84% what-template-file-am-i-viewing

Code Review | What Template File Am I Viewing?

WordPress plugin What Template File Am I Viewing? scored84%from 54 tests.

About plugin

  • Plugin page: what-template-fil...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-5.4.2
  • WordPress version: 6.3.1
  • First release: Mar 25, 2012
  • Latest release: Aug 6, 2020
  • Number of updates: 19
  • Update frequency: every 160.8 days
  • Top authors: themightymo (84.21%)vegasgeek (21.05%)

Code review

54 tests

User reviews

8 reviews

Install metrics

2,000+ active /26,339 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

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

Server-side resources used by What Template File Am I Viewing?
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0145.16 ▲2.92
Dashboard /wp-admin3.32 ▲0.0152.55 ▼4.35
Posts /wp-admin/edit.php3.37 ▲0.0150.92 ▼1.43
Add New Post /wp-admin/post-new.php5.90 ▲0.0199.07 ▼2.71
Media Library /wp-admin/upload.php3.24 ▲0.0137.83 ▲1.24

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for What Template File Am I Viewing?
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,803 ▲4214.07 ▼0.661.91 ▼0.0344.58 ▲2.01
Dashboard /wp-admin2,203 ▲265.59 ▼0.0787.73 ▼9.1139.36 ▼1.90
Posts /wp-admin/edit.php2,111 ▲81.97 ▼0.0152.70 ▲12.8951.81 ▲17.14
Add New Post /wp-admin/post-new.php1,528 ▲223.98 ▲0.80725.96 ▲47.1661.70 ▲10.03
Media Library /wp-admin/upload.php1,408 ▲84.19 ▼0.11100.31 ▼12.4246.67 ▼3.93

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/what-template-file-am-i-viewing/what-template-file-am-i-viewing.php:37

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 97% from 29 tests

readme.txt 94% 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 your attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === what-template-file-am-i-viewing === )
The official readme.txt might help

what-template-file-am-i-viewing/what-template-file-am-i-viewing.php Passed 13 tests

"What Template File Am I Viewing?" version 1.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
110 characters long description:
This is a debugging plugin that displays the current php file that is loading on the front end of the website.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin17 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1112417

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.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 were not PNG files found in your plugin