10% date-filter

Code Review | Date Filter

WordPress plugin Date Filter scored 10% from 54 tests.

About plugin

  • Plugin page: date-filter
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.1
  • WordPress version: 6.3.1
  • First release: Nov 29, 2017
  • Latest release: Dec 20, 2017
  • Number of updates: 26
  • Update frequency: every 0.8 days
  • Top authors: biprojit (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 1,051 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/date-filter/date-filter.php+97
    Undefined variable: args

Server metrics [RAM: ▼1.92MB] [CPU: ▼53.65ms] Passed 4 tests

Analyzing server-side resources used by Date Filter
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.404.75 ▼40.74
Dashboard /wp-admin2.09 ▼1.225.88 ▼47.14
Posts /wp-admin/edit.php2.09 ▼1.278.76 ▼42.26
Add New Post /wp-admin/post-new.php2.09 ▼3.806.61 ▼84.45
Media Library /wp-admin/upload.php2.09 ▼1.154.67 ▼34.65

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Date Filter
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲1113.22 ▼0.061.92 ▲0.2143.61 ▼7.94
Dashboard /wp-admin2,203 ▼64.86 ▼0.97107.93 ▼0.0539.51 ▲1.52
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0140.16 ▼0.5835.24 ▼0.19
Add New Post /wp-admin/post-new.php1,542 ▲14418.12 ▲0.24613.09 ▼41.9360.31 ▲14.50
Media Library /wp-admin/upload.php1,382 ▼64.22 ▼0.0198.42 ▼4.7941.79 ▼0.07

Uninstaller [IO: ✅] [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
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/date-filter/date-filter.php+97
    Undefined variable: args
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • widget_date_filter_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/date-filter/date-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 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Screenshots: Please add descriptions for these screenshots #1, #2 in date-filter/assets to your readme.txt
You can take inspiration from this readme.txt

date-filter/date-filter.php Passed 13 tests

The primary PHP file in "Date Filter" version 1.1 is used by WordPress to initiate all plugin functionality
52 characters long description:
Filter posts/products in your website by date range.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin77 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP220777

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.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

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.40MB with 0.28MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
1.PNG13.30KB6.45KB▼ 51.52%
2.PNG348.77KB75.43KB▼ 78.37%
Date-Filter.png52.63KB11.78KB▼ 77.61%