78% page-template-usage-info

Code Review | Page Template Usage Info

WordPress plugin Page Template Usage Info scored78%from 54 tests.

About plugin

  • Plugin page: page-template-usa...
  • Plugin version: 1.3.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.0.2
  • WordPress version: 6.3.1
  • First release: Jan 2, 2014
  • Latest release: Sep 1, 2022
  • Number of updates: 21
  • Update frequency: every 150.7 days
  • Top authors: shooper (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /2,559 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

A check of server-side resources used by Page Template Usage Info
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0340.23 ▼1.68
Dashboard /wp-admin3.34 ▲0.0343.55 ▼3.20
Posts /wp-admin/edit.php3.39 ▲0.0344.22 ▲0.47
Add New Post /wp-admin/post-new.php5.92 ▲0.0382.13 ▼11.90
Media Library /wp-admin/upload.php3.26 ▲0.0334.40 ▲1.98
Page Template Usage /wp-admin/edit.php?post_type=page&page=fti_page_templates3.2532.08

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Page Template Usage Info
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6013.25 ▼1.511.84 ▼0.1543.98 ▼10.24
Dashboard /wp-admin2,215 ▲275.85 ▲0.9596.06 ▼22.9139.92 ▼5.59
Posts /wp-admin/edit.php2,095 ▲32.05 ▲0.0134.42 ▼6.4334.56 ▼1.15
Add New Post /wp-admin/post-new.php1,537 ▲423.19 ▲0.08649.09 ▼13.8353.90 ▼6.36
Media Library /wp-admin/upload.php1,394 ▲124.20 ▼0.0495.72 ▼2.9740.37 ▼1.86
Page Template Usage /wp-admin/edit.php?post_type=page&page=fti_page_templates7781.6925.1326.89

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% 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 everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/page-template-usage-info/fti_page_templates.php on line 28
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATH/wp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/page-template-usage-info/fti_page_templates.php on line 28
    • > PHP Warning
      require_once(ABSPATH/wp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/page-template-usage-info/fti_page_templates.php on line 28

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > GET request to /wp-admin/edit.php?post_type=page&page=fti_page_templates
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).tablesorter is not a function" "TypeError: jQuery(...).tablesorter is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/edit.php?post_type=page&page=fti_page_templates:141:526)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/edit.php?post_type=page&page=fti_page_templates
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).tablesorter is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
8 plugin tags: auditing, blocks, gutenberg, templates, management...

page-template-usage-info/fti_page_templates.php 85% from 13 tests

The main PHP script in "Page Template Usage Info" version 1.3.4 is automatically included on every request by WordPress
You should first fix the following items:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("page-template-usage-info.php" instead of "fti_page_templates.php")

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
Success! There were no dangerous files found in this plugin168 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP1399872
Bourne Shell1201159
Sass16021
CSS12016

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity1.88
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.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
No PNG images were found in this plugin