93% admin-filter-posts-by-year

Code Review | Plugin Name: Admin filter posts by year

WordPress plugin Plugin Name: Admin filter posts by yearscored 93% from 54 tests.

About plugin

  • Plugin page: admin-filter-post...
  • Plugin version: 2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.8
  • WordPress version: 5.9.2
  • First release: May 8, 2014
  • Latest release: Aug 17, 2021
  • Number of updates: 13
  • Update frequency: every 204.9 days
  • Top authors: gilles66 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active / 2,994 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.09MB] [CPU: ▼290.77ms] Passed 4 tests

This is a short check of server-side resources used by Plugin Name: Admin filter posts by year
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0251.86 ▲1.10
Dashboard /wp-admin3.42 ▲0.0134.40 ▼0.02
Posts /wp-admin/edit.php3.33 ▼0.3126.98 ▼10.39
Add New Post /wp-admin/post-new.php6.90 ▼0.0797.60 ▼1,145.79
Media Library /wp-admin/upload.php3.30 ▲0.0025.32 ▼6.87

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 3 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Plugin Name: Admin filter posts by year
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,763 ▲915.75 ▼0.295.78 ▼0.872.17 ▼1.03
Dashboard /wp-admin2,892 ▲346.12 ▼0.09116.80 ▼18.43155.16 ▼10.24
Posts /wp-admin/edit.php2,693 ▼13.24 ▼0.0064.24 ▼0.16144.58 ▼1.80
Add New Post /wp-admin/post-new.php1,773 ▲2121.95 ▲0.92462.45 ▲7.88159.90 ▲0.13
Media Library /wp-admin/upload.php1,695 ▼35.49 ▼0.03144.28 ▲9.64188.47 ▲1.97

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/admin-filter-posts-by-year/gwp_filter_posts_by_years.php:14

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 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === Plugin Name: Admin filter posts by year=== )
You can take inspiration from this readme.txt

admin-filter-posts-by-year/gwp_filter_posts_by_years.php 85% from 13 tests

The main PHP file in "Plugin Name: Admin filter posts by year" ver. 2.2 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("admin-filter-posts-by-year.php" instead of "gwp_filter_posts_by_years.php")
  • Description: The description should be shorter than 140 characters (currently 150 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 detected75 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2315875

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.24
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%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin