73% cool-media-filter

Code Review | Cool Media Filter

WordPress plugin Cool Media Filter scored73%from 54 tests.

About plugin

  • Plugin page: cool-media-filter
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jun 7, 2018
  • Latest release: Jun 15, 2018
  • Number of updates: 10
  • Update frequency: every 1.0 days
  • Top authors: subrataemfluence (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /864 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

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

Server-side resources used by Cool Media Filter
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1639.76 ▲0.73
Dashboard /wp-admin3.50 ▲0.1952.41 ▲3.42
Posts /wp-admin/edit.php3.62 ▲0.2651.35 ▲0.37
Add New Post /wp-admin/post-new.php6.11 ▲0.2290.71 ▼5.90
Media Library /wp-admin/upload.php3.35 ▲0.1234.20 ▼2.57
Add New Role /wp-admin/admin.php?page=cmf-new-user-role3.3936.43
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=attachment3.4338.93
Roles and Permissions /wp-admin/admin.php?page=cmf-user-roles3.3936.12
Category Access /wp-admin/admin.php?page=cmf-manage-category-access3.3937.63
Overview /wp-admin/admin.php?page=cmf-plugin-overview3.3932.70

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 13 new files
Database: 1 new table, 9 new options
New tables
wp_category_role
New WordPress options
widget_theysaidso_widget
category_item_access_by_role
can_compress_scripts
recovery_mode_email_last_sent
category_children
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Cool Media Filter
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,847 ▲10113.57 ▼0.811.93 ▲0.0939.88 ▼2.19
Dashboard /wp-admin2,253 ▲624.85 ▼1.04107.67 ▲2.0939.82 ▼5.76
Posts /wp-admin/edit.php2,139 ▲502.00 ▼0.0040.53 ▲3.2234.39 ▼2.62
Add New Post /wp-admin/post-new.php1,554 ▲1223.17 ▲0.23656.27 ▼13.8151.97 ▼11.81
Media Library /wp-admin/upload.php57 ▼1,3340.44 ▼3.770.12 ▼102.109.70 ▼35.27
Add New Role /wp-admin/admin.php?page=cmf-new-user-role9762.0627.8127.11
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=attachment1,4902.1429.3137.22
Roles and Permissions /wp-admin/admin.php?page=cmf-user-roles1,2952.0625.0332.31
Category Access /wp-admin/admin.php?page=cmf-manage-category-access8742.0326.3629.02
Overview /wp-admin/admin.php?page=cmf-plugin-overview8362.0527.5545.77

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_category_role
  • The uninstall procedure has failed, leaving 9 options in the database
    • category_item_access_by_role
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • recovery_mode_email_last_sent
    • widget_theysaidso_widget
    • category_children
    • 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
Everything seems fine, however this is by no means an exhaustive test

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 take a closer look at the following
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Walker_CategoryDropdown' not found in wp-content/plugins/cool-media-filter/classes/class-coolmediafilter-walker-category-mediagrid-filter.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/cool-media-filter/class-coolmediafilter.php:73
    • > PHP Fatal error
      Uncaught Error: Class 'Walker' not found in wp-content/plugins/cool-media-filter/classes/class-coolmediafilter-walker-media-taxonomy-checklist.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Walker_CategoryDropdown' not found in wp-content/plugins/cool-media-filter/classes/class-coolmediafilter-walker-category-filter.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === cool-media-filter === )
  • Tags: There are too many tags (12 tag instead of maximum 10)
You can take inspiration from this readme.txt

cool-media-filter/class-coolmediafilter.php 92% from 13 tests

The primary PHP file in "Cool Media Filter" version 1.0.1 is used by WordPress to initiate all plugin functionality
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 ("cool-media-filter.php" instead of "class-coolmediafilter.php")

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
Good job! No executable or dangerous file extensions detected1,387 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP62974381,089
JavaScript42822151
CSS1202123
Markdown111024

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity25.20
▷ Minimum class complexity1.00
▷ Maximum class complexity112.00
Average method complexity3.05
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods59
▷ Static methods610.17%
▷ Public methods59100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin