10% filtering-custom-post-type

Code Review | Filtering Custom Post Type

WordPress plugin Filtering Custom Post Type scored10%from 54 tests.

About plugin

  • Plugin page: filtering-custom-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8.4-5.5.1
  • WordPress version: 6.3.1
  • First release: Oct 27, 2020
  • Latest release: Oct 27, 2020
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: desparza (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /455 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • The plugin did not install without errors
    • > Warning in wp-content/plugins/filtering-custom-post-type/includes/filtering-custom-post-type-functions.php+8
    Use of undefined constant enable_filtering - assumed 'enable_filtering' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.96MB] [CPU: ▼44.15ms] Passed 4 tests

An overview of server-side resources used by Filtering Custom Post Type
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.444.96 ▼29.14
Dashboard /wp-admin2.05 ▼1.266.95 ▼33.03
Posts /wp-admin/edit.php2.05 ▼1.315.92 ▼33.29
Add New Post /wp-admin/post-new.php2.05 ▼3.845.32 ▼81.12
Media Library /wp-admin/upload.php2.05 ▼1.185.14 ▼26.17
Filtering Custom Post Type /wp-admin/admin.php?page=dewp-fcpt-admin-settings2.056.19
Sobre Daniel Esparza /wp-admin/admin.php?page=desparza-menu2.057.91

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Filtering Custom Post Type
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.29 ▼1.311.71 ▲0.0244.28 ▲8.31
Dashboard /wp-admin2,228 ▲395.81 ▲0.8498.00 ▼25.9443.98 ▼1.30
Posts /wp-admin/edit.php2,111 ▲252.01 ▲0.0234.65 ▼1.9134.29 ▲3.69
Add New Post /wp-admin/post-new.php1,549 ▲1223.07 ▲4.77624.94 ▼25.6852.81 ▲3.91
Media Library /wp-admin/upload.php1,413 ▲254.21 ▲0.0093.73 ▼16.3745.14 ▼2.73
Filtering Custom Post Type /wp-admin/admin.php?page=dewp-fcpt-admin-settings9682.0322.6228.81
Sobre Daniel Esparza /wp-admin/admin.php?page=desparza-menu8022.0624.3628.27

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/filtering-custom-post-type/includes/filtering-custom-post-type-functions.php+8
    Use of undefined constant enable_filtering - assumed 'enable_filtering' (this will throw an Error in a future version of PHP)
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=desparza-menu
    • > Warning in wp-content/plugins/filtering-custom-post-type/includes/filtering-custom-post-type-functions.php+178
    Use of undefined constant enable_filtering - assumed 'enable_filtering' (this will throw an Error in a future version of PHP)
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=desparza-menu
    • > Notice in wp-content/plugins/filtering-custom-post-type/includes/filtering-custom-post-type-functions.php+178
    Trying to access array offset on value of type bool

SRP 0% 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
Please fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/filtering-custom-post-type/filtering-custom-post-type.php
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant enable_filtering - assumed 'enable_filtering' (this will throw an Error in a future version of PHP) in wp-content/plugins/filtering-custom-post-type/includes/filtering-custom-post-type-functions.php on line 8
    • > PHP Notice
      Undefined variable: dewp_options in wp-content/plugins/filtering-custom-post-type/includes/filtering-custom-post-type-functions.php on line 178
    • > PHP Warning
      Use of undefined constant enable_filtering - assumed 'enable_filtering' (this will throw an Error in a future version of PHP) in wp-content/plugins/filtering-custom-post-type/includes/filtering-custom-post-type-functions.php on line 178
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/filtering-custom-post-type/includes/filtering-custom-post-type-admin.php:11
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/filtering-custom-post-type/includes/filtering-custom-post-type-functions.php on line 178
    • > PHP Notice
      Undefined variable: dewp_options in wp-content/plugins/filtering-custom-post-type/includes/filtering-custom-post-type-functions.php on line 8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/filtering-custom-post-type/includes/filtering-custom-post-type-functions.php on line 8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% 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:
  • Requires php: Version format is invalid
You can look at the official readme.txt

filtering-custom-post-type/filtering-custom-post-type.php 92% from 13 tests

The main PHP file in "Filtering Custom Post Type" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 289 characters long)

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
No dangerous file extensions were detected382 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP48242358
JavaScript271214
CSS352110

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.21
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%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/default.png4.15KB2.12KB▼ 48.92%