84% ymc-smart-filter

Code Review | Filter & Grids

WordPress plugin Filter & Grids scored84%from 54 tests.

About plugin

  • Plugin page: ymc-smart-filter
  • Plugin version: 2.6.20
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.4
  • WordPress version: 6.3.1
  • First release: Aug 16, 2022
  • Latest release: Dec 2, 2023
  • Number of updates: 208
  • Update frequency: every 2.3 days
  • Top authors: wssoffice21 (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

300+ active /8,863 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.50MB] [CPU: ▲0.32ms] Passed 4 tests

This is a short check of server-side resources used by Filter & Grids
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.00 ▲0.5445.06 ▲9.26
Dashboard /wp-admin3.84 ▲0.5347.07 ▲0.50
Posts /wp-admin/edit.php3.89 ▲0.5350.70 ▲2.29
Add New Post /wp-admin/post-new.php6.38 ▲0.4992.48 ▼5.10
Media Library /wp-admin/upload.php3.70 ▲0.4735.96 ▲3.57
Add New /wp-admin/post-new.php?post_type=ymc_filters4.1554.21
Filter & Grids /wp-admin/edit.php?post_type=ymc_filters3.8037.94

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 112 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Filter & Grids
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,012 ▲25014.05 ▼0.6510.36 ▲8.7246.23 ▲7.27
Dashboard /wp-admin2,299 ▲1225.87 ▲0.2494.18 ▼5.8442.24 ▲1.12
Posts /wp-admin/edit.php2,161 ▲612.34 ▲0.3743.19 ▲2.7435.03 ▼3.37
Add New Post /wp-admin/post-new.php1,567 ▲4123.48 ▲0.17606.05 ▼9.6933.57 ▼15.82
Media Library /wp-admin/upload.php1,459 ▲594.51 ▲0.3498.66 ▼0.5640.78 ▼1.23
Add New /wp-admin/post-new.php?post_type=ymc_filters6,2034.53136.73132.25
Filter & Grids /wp-admin/edit.php?post_type=ymc_filters1,1222.3037.5529.54

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: ymc_popup_settings in wp-content/plugins/ymc-smart-filter/includes/core/frontend/layouts/popup/popup-layout.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/ymc-smart-filter/includes/core/frontend/layouts/popup/popup-layout.php:19
    • > PHP Notice
      Undefined variable: ymc_popup_settings in wp-content/plugins/ymc-smart-filter/includes/core/frontend/layouts/popup/popup-layout.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/ymc-smart-filter/includes/core/frontend/layouts/popup/popup-layout.php on line 3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/ymc-smart-filter/includes/core/frontend/layouts/popup/popup-layout.php on line 6
    • > PHP Notice
      Undefined variable: ymc_popup_settings in wp-content/plugins/ymc-smart-filter/includes/core/frontend/layouts/popup/popup-layout.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/ymc-smart-filter/includes/core/util/icons.php:9
    • > PHP Notice
      Undefined variable: ymc_popup_settings in wp-content/plugins/ymc-smart-filter/includes/core/frontend/layouts/popup/popup-layout.php on line 3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/ymc-smart-filter/includes/core/frontend/layouts/popup/popup-layout.php on line 4
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/ymc-smart-filter/includes/core/frontend/layouts/popup/popup-layout.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% 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:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
The official readme.txt is a good inspiration

ymc-smart-filter/ymc-smart-filters.php 92% from 13 tests

"Filter & Grids" version 2.6.20's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ymc-smart-filter.php" instead of "ymc-smart-filters.php")

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
There were no executable files found in this plugin24,194 lines of code in 87 files:
LanguageFilesBlank linesComment linesLines of code
SVG15109,791
Sass21644536,969
PHP421,5204194,845
JavaScript55881072,009
Markdown11670577
CSS31283

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity22.82
▷ Minimum class complexity1.00
▷ Maximum class complexity68.00
Average method complexity3.27
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods105
▷ Static methods21.90%
▷ Public methods10297.14%
▷ Protected methods00.00%
▷ Private methods32.86%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants4
▷ Global constants375.00%
▷ Class constants125.00%
▷ Public constants1100.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.04MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/assets/images/YMC-logos.png31.70KB10.33KB▼ 67.39%
includes/assets/images/logo.png4.88KB0.78KB▼ 84.05%