10% blog-post-filter

Code Review | Blog Post Filter

WordPress plugin Blog Post Filter scored 10% from 54 tests.

About plugin

  • Plugin page: blog-post-filter
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.4-5.4
  • WordPress version: 6.3.1
  • First release: Oct 10, 2015
  • Latest release: Apr 2, 2020
  • Number of updates: 14
  • Update frequency: every 116.9 days
  • Top authors: ammar.shahraki (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

500+ active / 9,790 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/blog-post-filter/adminPage.php+2
    Methods with the same name as their class will not be constructors in a future version of PHP; BlogPostFilterAdminPage has a deprecated constructor

Server metrics [RAM: ▼1.91MB] [CPU: ▼53.93ms] Passed 4 tests

A check of server-side resources used by Blog Post Filter
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.385.59 ▼33.09
Dashboard /wp-admin2.11 ▼1.206.13 ▼46.60
Posts /wp-admin/edit.php2.11 ▼1.256.75 ▼48.71
Add New Post /wp-admin/post-new.php2.11 ▼3.786.32 ▼87.30
Media Library /wp-admin/upload.php2.11 ▼1.139.03 ▼26.78
post filtering /wp-admin/edit.php?page=blog-post-filter-setting2.115.83

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
category_children
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Blog Post Filter
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲4013.23 ▲0.042.29 ▲0.1644.59 ▼3.71
Dashboard /wp-admin2,210 ▲45.83 ▼0.08108.83 ▲6.7339.58 ▼2.29
Posts /wp-admin/edit.php2,096 ▲72.00 ▲0.0339.19 ▼3.4735.30 ▼4.97
Add New Post /wp-admin/post-new.php1,523 ▼1023.25 ▲0.08702.65 ▼1.6572.24 ▲13.65
Media Library /wp-admin/upload.php1,389 ▲44.21 ▲0.09102.85 ▲0.8344.10 ▲1.62
post filtering /wp-admin/edit.php?page=blog-post-filter-setting7762.0427.0327.00

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/blog-post-filter/adminPage.php+2
    Methods with the same name as their class will not be constructors in a future version of PHP; BlogPostFilterAdminPage has a deprecated constructor
  • The uninstall procedure has failed, leaving 7 options in the database
    • category_children
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/edit.php?page=blog-post-filter-setting
    • > Deprecated in wp-content/plugins/blog-post-filter/adminPage.php+2
    Methods with the same name as their class will not be constructors in a future version of PHP; BlogPostFilterAdminPage has a deprecated constructor
    • > GET request to /wp-admin/edit.php?page=blog-post-filter-setting
    • > Notice in wp-content/plugins/blog-post-filter/adminPage.php+24
    Trying to access array offset on value of type bool

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
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/blog-post-filter/blog-post-filter.php:16

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)
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: filter, frontpage, categories, category, post

blog-post-filter/blog-post-filter.php Passed 13 tests

The main PHP script in "Blog Post Filter" version 1.1.0 is automatically included on every request by WordPress
61 characters long description:
Blog Post Filter filters frontpage posts by their categories.

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
No dangerous file extensions were detected172 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP22731136
PO File1111736

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity8.50
▷ Minimum class complexity8.00
▷ Maximum class complexity9.00
Average method complexity2.36
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.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
There were not PNG files found in your plugin