72% filter-sorter

Code Review | Filter & Sorter

WordPress plugin Filter & Sorter scored72%from 54 tests.

About plugin

  • Plugin page: filter-sorter
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.0
  • WordPress version: 6.3.1
  • First release: Dec 26, 2019
  • Latest release: Dec 26, 2019
  • Number of updates: 5
  • Update frequency: every 0.4 days
  • Top authors: contrive (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /487 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.17MB] [CPU: ▲0.85ms] Passed 4 tests

A check of server-side resources used by Filter & Sorter
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1545.40 ▲2.90
Dashboard /wp-admin3.47 ▲0.1759.11 ▲1.87
Posts /wp-admin/edit.php3.59 ▲0.2353.65 ▲2.42
Add New Post /wp-admin/post-new.php6.07 ▲0.1992.94 ▼2.73
Media Library /wp-admin/upload.php3.39 ▲0.1741.81 ▲1.85
Sorters /wp-admin/options-general.php?page=sorter_options3.3434.62
Filters /wp-admin/options-general.php?page=filter_options3.3434.66

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 25 new files
Database: no new tables, 11 new options
New WordPress options
sorter_social_options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
filter_sorter_display_options
sorter_display_options
widget_recent-posts
widget_recent-comments
recovery_mode_email_last_sent
filter_sorter_social_options
...

Browser metrics Passed 4 tests

A check of browser resources used by Filter & Sorter
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,909 ▲14813.42 ▼0.987.85 ▲5.9845.57 ▼1.81
Dashboard /wp-admin2,210 ▲335.67 ▲0.0186.70 ▼2.3837.62 ▼11.72
Posts /wp-admin/edit.php2,115 ▲122.01 ▲0.0239.69 ▼0.6832.34 ▼5.82
Add New Post /wp-admin/post-new.php1,536 ▼323.36 ▲0.14679.36 ▲16.9954.29 ▼1.32
Media Library /wp-admin/upload.php1,409 ▲94.18 ▲0.01112.30 ▲5.2646.40 ▲0.37
Sorters /wp-admin/options-general.php?page=sorter_options7271.526.8724.58
Filters /wp-admin/options-general.php?page=filter_options7271.527.2722.87

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 11 options in the database
    • can_compress_scripts
    • sorter_display_options
    • widget_recent-posts
    • filter_sorter_social_options
    • theysaidso_admin_options
    • widget_recent-comments
    • recovery_mode_email_last_sent
    • widget_theysaidso_widget
    • filter_sorter_display_options
    • db_upgraded
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=sorter_options
    • > Error in wp-content/plugins/filter-sorter/admin/class-filter_sorter-admin-settings.php+538
    Uncaught Error: Call to undefined function acf_get_field_groups() in wp-content/plugins/filter-sorter/admin/class-filter_sorter-admin-settings.php:538
    Stack trace:
    #0 wp-admin/includes/template.php(1824): Filter_sorter_Admin_Settings->checkbox_element_callback_sorter()
    #1 wp-admin/includes/template.php(1778): do_settings_fields()
    #2 wp-content/plugins/filter-sorter/admin/class-filter_sorter-admin-settings.php(207): do_settings_sections()
    #3 wp-includes/class-wp-hook.php(310): Filter_sorter_Admin_Settings->render_settings_page_content_sorter()
    #4 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #5 wp-includes/plugin.php(517): WP_Hook->do_action()
    #6 wp-admin/admin.php(259): do_action()
    #7 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #8 {main}
    thrown
    • > GET request to /wp-admin/options-general.php?page=filter_options
    • > Error in wp-content/plugins/filter-sorter/admin/class-filter_sorter-admin-settings.php+451
    Uncaught Error: Call to undefined function acf_get_field_groups() in wp-content/plugins/filter-sorter/admin/class-filter_sorter-admin-settings.php:451
    Stack trace:
    #0 wp-admin/includes/template.php(1824): Filter_sorter_Admin_Settings->checkbox_element_callback()
    #1 wp-admin/includes/template.php(1778): do_settings_fields()
    #2 wp-content/plugins/filter-sorter/admin/class-filter_sorter-admin-settings.php(154): do_settings_sections()
    #3 wp-includes/class-wp-hook.php(310): Filter_sorter_Admin_Settings->render_settings_page_content()
    #4 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #5 wp-includes/plugin.php(517): WP_Hook->do_action()
    #6 wp-admin/admin.php(259): do_action()
    #7 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #8 {main}
    thrown

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
Please fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/filter-sorter/public/partials/filter_sorter-public-display.php
    • > /wp-content/plugins/filter-sorter/admin/partials/filter_sorter-admin-display.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=filter_options
    • > Network (severe)
    wp-content/plugins/filter-sorter/admin/css/filter_sorter-admin.css?ver=1.0.0 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Donate link: Please fix this invalid url: "contriverz.com"
  • Screenshots: Please add images for these screenshots: #1 (Filter page.), #2 (Sorter page)
The official readme.txt is a good inspiration

filter-sorter/filter_sorter.php 85% from 13 tests

The principal PHP file in "Filter & Sorter" v. 1.0.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("filter-sorter.php" instead of "filter_sorter.php")

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 plugin797 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP13318737777
JavaScript255619
CSS2041

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity13.62
▷ Minimum class complexity1.00
▷ Maximum class complexity99.00
Average method complexity2.64
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods63
▷ Static methods23.17%
▷ Public methods5790.48%
▷ Protected methods00.00%
▷ Private methods69.52%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
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
assets/screenshot_1.png23.79KB12.29KB▼ 48.32%
assets/screenshot_2.png22.76KB11.45KB▼ 49.71%