84% desire-portfolio-filter

Code Review | Desire Portfolio Filter

WordPress plugin Desire Portfolio Filter scored 84% from 54 tests.

About plugin

  • Plugin page: desire-portfolio-...
  • Plugin version: 0.2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.7.1
  • WordPress version: 6.3.1
  • First release: Nov 10, 2015
  • Latest release: Nov 26, 2015
  • Number of updates: 30
  • Update frequency: every 14.9 days
  • Top authors: desirelabs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,307 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.83ms] Passed 4 tests

A check of server-side resources used by Desire Portfolio Filter
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0043.21 ▲0.14
Dashboard /wp-admin3.31 ▲0.0046.09 ▼2.10
Posts /wp-admin/edit.php3.36 ▲0.0044.05 ▼5.84
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.05 ▼13.06
Media Library /wp-admin/upload.php3.23 ▲0.0033.72 ▼2.32

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Desire Portfolio Filter
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.32 ▼0.984.52 ▲2.3239.11 ▼8.68
Dashboard /wp-admin2,209 ▲215.88 ▲0.99100.99 ▼15.1542.92 ▼0.94
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0337.90 ▼3.9730.67 ▼6.44
Add New Post /wp-admin/post-new.php1,534 ▼323.15 ▲4.86676.08 ▲56.6457.65 ▼6.31
Media Library /wp-admin/upload.php1,388 ▼04.20 ▲0.0398.01 ▼2.4442.35 ▼1.95

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/desire-portfolio-filter/DesirePortfolioFilter.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/desire-portfolio-filter/src/templates/portfolio-template.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: cards, isotope, jetpack, portfolio, masonry...

desire-portfolio-filter/DesirePortfolioFilter.php 92% from 13 tests

The principal PHP file in "Desire Portfolio Filter" v. 0.2.4 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("desire-portfolio-filter.php" instead of "DesirePortfolioFilter.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected301 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP46169179
PO File2113556
CSS113544
JavaScript372222

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity1.89
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods9
▷ Static methods666.67%
▷ Public methods888.89%
▷ Protected methods00.00%
▷ Private methods111.11%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants2
▷ Global constants2100.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
No PNG files were detected