88% category-ajax-filter

Code Review | Category Ajax Filter

WordPress plugin Category Ajax Filter scored 88% from 54 tests.

About plugin

  • Plugin page: category-ajax-filter
  • Plugin version: 1.8.8
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.8
  • WordPress version: 5.8.1
  • First release: Oct 31, 2020
  • Latest release: Sep 4, 2021
  • Number of updates: 207
  • Update frequency: every 1.5 days
  • Top authors: trustyplugins (100%)

Code review

54 tests

User reviews

40 reviews

Install metrics

2,000+ active / 23,482 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.21MB] [CPU: ▼139.62ms] Passed 4 tests

Analyzing server-side resources used by Category Ajax Filter
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.01 ▲0.2941.44 ▲18.68
Dashboard /wp-admin3.30 ▲0.2457.24 ▼2.22
Posts /wp-admin/edit.php3.35 ▲0.2456.56 ▲7.60
Add New Post /wp-admin/post-new.php5.60 ▲0.16103.77 ▼559.89
Media Library /wp-admin/upload.php3.18 ▲0.1838.25 ▼3.98
Add New /wp-admin/post-new.php?post_type=caf_posts3.3055.93
Category Filter /wp-admin/edit.php?post_type=caf_posts3.2242.02

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 122 new files
Database: no new tables, 1 new option
New WordPress options
tc_caf_plugin_version

Browser metrics Passed 4 tests

An overview of browser requirements for Category Ajax Filter
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,718 ▲12215.92 ▲0.209.17 ▼1.2550.48 ▼9.46
Dashboard /wp-admin3,006 ▲806.16 ▲0.17162.08 ▲4.03127.49 ▲2.75
Posts /wp-admin/edit.php2,778 ▲392.73 ▲0.0086.16 ▲16.4397.98 ▲4.21
Add New Post /wp-admin/post-new.php1,643 ▼4021.48 ▲5.25299.65 ▼121.19115.20 ▼4.09
Media Library /wp-admin/upload.php1,846 ▲395.06 ▲0.06201.09 ▲32.00119.27 ▼9.19
Add New /wp-admin/post-new.php?post_type=caf_posts5,5805.15198.70229.18
Category Filter /wp-admin/edit.php?post_type=caf_posts1,4722.78137.45118.49

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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 output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/category-ajax-filter/category-ajax-filter.php
  • 37× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/category-ajax-filter/includes/layouts/post/post-layout2.php:3
    • > PHP Fatal error
      require_once(): Failed opening required 'TC_CAF_PATHadmin/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/category-ajax-filter/admin/admin.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/category-ajax-filter/admin/tabs/typography.php:3
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/category-ajax-filter/includes/layouts/post/post-layout1.php:3
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/category-ajax-filter/includes/layouts/post/post-layout4.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/category-ajax-filter/includes/functions.php:73
    • > PHP Warning
      include_once(): Failed opening 'TC_CAF_PATHincludes/query-variables.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/category-ajax-filter/includes/layouts/post/post-layout3.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/category-ajax-filter/includes/front-variables.php:5
    • > PHP Warning
      include_once(): Failed opening 'TC_CAF_PATHincludes/query-variables.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/category-ajax-filter/includes/layouts/post/post-layout1.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/category-ajax-filter/admin/tabs/general.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% 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
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (screenshot-1.png), #2 (screenshot-2.png), #3 (screenshot-3.png)
The official readme.txt is a good inspiration

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

The main PHP file in "Category Ajax Filter" ver. 1.8.8 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Description: Please keep the plugin description shorter than 140 characters (currently 172 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
There were no executable files found in this plugin41,508 lines of code in 65 files:
LanguageFilesBlank linesComment linesLines of code
CSS282,91910119,608
SVG40011,282
JavaScript102,2231,7338,074
PHP234021122,544

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity7.62
▷ Minimum class complexity1.00
▷ Maximum class complexity38.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods43
▷ Static methods00.00%
▷ Public methods43100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants685.71%
▷ Class constants114.29%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/full-logo.png43.16KB16.32KB▼ 62.19%
admin/images/logo-icon.png3.39KB2.39KB▼ 29.68%