83% ajax-filter-posts

Code Review | Post Grid Master - The Ultimate Post Grid Solution with Ajax

WordPress plugin Post Grid Master - The Ultimate Post Grid Solution with Ajax scored83%from 54 tests.

About plugin

  • Plugin page: ajax-filter-posts
  • Plugin version: 3.4.5
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Mar 8, 2018
  • Latest release: Nov 27, 2023
  • Number of updates: 54
  • Update frequency: every 38.7 days
  • Top authors: mdshuvo (96.3%)mdashikul (5.56%)

Code review

54 tests

User reviews

15 reviews

Install metrics

1,000+ active /23,049 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.37MB] [CPU: ▼0.74ms] Passed 4 tests

This is a short check of server-side resources used by Post Grid Master - The Ultimate Post Grid Solution with Ajax
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3337.59 ▼1.63
Dashboard /wp-admin3.73 ▲0.4347.90 ▼1.08
Posts /wp-admin/edit.php3.78 ▲0.4253.55 ▲3.60
Add New Post /wp-admin/post-new.php6.27 ▲0.3892.34 ▼1.96
Media Library /wp-admin/upload.php3.59 ▲0.3634.17 ▲1.69
Welcome /wp-admin/admin.php?page=gridmaster3.6034.49

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 36 new files
Database: no new tables, 7 new options
New WordPress options
gridmaster_activation_time
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Post Grid Master - The Ultimate Post Grid Solution with Ajax
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,943 ▲18113.78 ▼0.579.20 ▲7.5137.89 ▼7.27
Dashboard /wp-admin2,240 ▲635.64 ▲0.0191.62 ▼35.9641.62 ▼11.90
Posts /wp-admin/edit.php2,145 ▲452.03 ▲0.0340.30 ▲0.1637.01 ▼4.19
Add New Post /wp-admin/post-new.php1,562 ▲2723.69 ▼1.58625.22 ▼14.2849.20 ▼28.73
Media Library /wp-admin/upload.php1,436 ▲394.30 ▲0.1495.33 ▼0.6441.53 ▲0.02
Welcome /wp-admin/admin.php?page=gridmaster1,1352.0330.7751.06

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • gridmaster_activation_time
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ajax-filter-posts/admin/views/templates.php:6
    • > PHP Warning
      Use of undefined constant GRIDMASTER_PATH - assumed 'GRIDMASTER_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ajax-filter-posts/admin/views/build-grid.php on line 3
    • > PHP Warning
      Use of undefined constant GRIDMASTER_PATH - assumed 'GRIDMASTER_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ajax-filter-posts/admin/views/settings.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/ajax-filter-posts/admin/views/welcome.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function gridmaster_post_thumbnail() in wp-content/plugins/ajax-filter-posts/templates/grid/style-2.php:4
    • > PHP Fatal error
      require_once(): Failed opening required 'GRIDMASTER_PATH/admin/admin-functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/ajax-filter-posts/admin/views/settings.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/ajax-filter-posts/inc/functions.php:130
    • > PHP Fatal error
      Uncaught Error: Call to undefined function gridmaster_post_thumbnail() in wp-content/plugins/ajax-filter-posts/templates/grid/style-3.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function gridmaster_post_thumbnail() in wp-content/plugins/ajax-filter-posts/templates/grid/default.php:4
    • > PHP Warning
      require_once(GRIDMASTER_PATH/admin/admin-functions.php): failed to open stream: No such file or directory in wp-content/plugins/ajax-filter-posts/admin/views/settings.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Tags: You are using too many tags: 28 tag instead of maximum 10
The official readme.txt is a good inspiration

ajax-filter-posts/ajax-filter-posts.php 85% from 13 tests

This is the main PHP file of "Post Grid Master - The Ultimate Post Grid Solution with Ajax" version 3.4.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Description: Please keep the plugin description shorter than 140 characters (currently 280 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
Success! There were no dangerous files found in this plugin4,370 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP186937643,080
CSS710630800
JavaScript211092310
Markdown1830180

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity38.60
▷ Minimum class complexity6.00
▷ Maximum class complexity82.00
Average method complexity3.17
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes120.00%
Methods79
▷ Static methods45.06%
▷ Public methods6177.22%
▷ Protected methods56.33%
▷ Private methods1316.46%
Functions27
▷ Named functions2488.89%
▷ Anonymous functions311.11%
Constants6
▷ Global constants6100.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
2 PNG files occupy 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/tmpl-imgs/template-1.png64.00KB26.33KB▼ 58.86%
assets/img/all.png5.61KB2.93KB▼ 47.70%