84% filter-page-by-template

Code Review | Filter Page by Template

WordPress plugin Filter Page by Template scored84%from 54 tests.

About plugin

  • Plugin page: filter-page-by-te...
  • Plugin version: 3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Mar 8, 2016
  • Latest release: Jan 17, 2023
  • Number of updates: 34
  • Update frequency: every 73.7 days
  • Top authors: onetarek (100%)

Code review

54 tests

User reviews

45 reviews

Install metrics

3,000+ active /40,017 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.00MB] [CPU: ▼2.93ms] Passed 4 tests

This is a short check of server-side resources used by Filter Page by Template
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.18 ▼7.29
Dashboard /wp-admin3.31 ▲0.0145.71 ▼5.16
Posts /wp-admin/edit.php3.34 ▼0.0146.57 ▼2.57
Add New Post /wp-admin/post-new.php5.89 ▲0.0196.92 ▲6.41
Media Library /wp-admin/upload.php3.23 ▲0.0033.84 ▲3.30

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

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

Browser metrics Passed 4 tests

Filter Page by Template: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.48 ▼0.211.78 ▼0.1144.70 ▼2.97
Dashboard /wp-admin2,206 ▲185.91 ▲0.87105.34 ▼10.4540.00 ▼4.00
Posts /wp-admin/edit.php2,120 ▲282.02 ▲0.0339.77 ▲0.7736.53 ▲2.04
Add New Post /wp-admin/post-new.php1,534 ▲1723.45 ▲5.96589.81 ▼30.2757.38 ▲1.78
Media Library /wp-admin/upload.php1,391 ▲34.14 ▼0.0894.91 ▼4.2241.61 ▼4.63

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

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 everything seems fine, this is not 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
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/filter-page-by-template/filter-page-by-template.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/filter-page-by-template/includes/five_star_wp_rate_notice.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
4 plugin tags: template filter, missing templates, page list, filter

filter-page-by-template/filter-page-by-template.php 92% from 13 tests

"Filter Page by Template" version 3.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 179 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected186 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP24015152
JavaScript12023
Markdown16011

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity11.50
▷ Minimum class complexity5.00
▷ Maximum class complexity18.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin