78% custom-query-shortcode

Code Review | Custom Query Shortcode

WordPress plugin Custom Query Shortcode scored78%from 54 tests.

About plugin

  • Plugin page: custom-query-shor...
  • Plugin version: 0.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.7
  • WordPress version: 6.3.1
  • First release: Sep 22, 2015
  • Latest release: Apr 10, 2021
  • Number of updates: 12
  • Update frequency: every 170.3 days
  • Top authors: peterhebert (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /2,163 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
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.79ms] Passed 4 tests

This is a short check of server-side resources used by Custom Query Shortcode
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.29 ▼3.78
Dashboard /wp-admin3.33 ▲0.0344.94 ▼4.32
Posts /wp-admin/edit.php3.38 ▲0.0347.50 ▼0.68
Add New Post /wp-admin/post-new.php5.91 ▲0.0390.95 ▼10.36
Media Library /wp-admin/upload.php3.26 ▲0.0334.25 ▲2.87

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 12 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

Checking browser requirements for Custom Query Shortcode
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲6713.63 ▼0.991.90 ▲0.0742.34 ▲2.08
Dashboard /wp-admin2,206 ▲185.84 ▲0.93104.97 ▼1.8341.60 ▼0.62
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.1638.93 ▼1.5834.63 ▼0.42
Add New Post /wp-admin/post-new.php1,534 ▲523.20 ▲4.84662.42 ▲18.5450.81 ▼4.19
Media Library /wp-admin/upload.php1,388 ▼34.18 ▼0.0092.69 ▼6.2242.00 ▲0.03

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/custom-query-shortcode/init.php
  • 16× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: posts in wp-content/plugins/custom-query-shortcode/lenses/article-excerpt-date.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/custom-query-shortcode/lenses/article-excerpt-date.php:11
    • > PHP Notice
      Undefined variable: posts in wp-content/plugins/custom-query-shortcode/lenses/tabs.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/custom-query-shortcode/lenses/ul.php:10
    • > PHP Notice
      Undefined variable: posts in wp-content/plugins/custom-query-shortcode/lenses/accordion.php on line 11
    • > PHP Notice
      Undefined variable: posts in wp-content/plugins/custom-query-shortcode/lenses/ul-title-date.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/custom-query-shortcode/lenses/cards.php:11
    • > PHP Notice
      Undefined variable: posts in wp-content/plugins/custom-query-shortcode/lenses/ul.php on line 10
    • > PHP Notice
      Undefined variable: posts in wp-content/plugins/custom-query-shortcode/lenses/cards.php on line 11
    • > PHP Notice
      Undefined variable: posts in wp-content/plugins/custom-query-shortcode/lenses/carousel.php on line 11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: query, shortcode, post

custom-query-shortcode/init.php 92% from 13 tests

This is the main PHP file of "Custom Query Shortcode" version 0.4.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("custom-query-shortcode.php" instead of "init.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
Everything looks great! No dangerous files found in this plugin213 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP951137211
CSS2002

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity28.00
▷ Minimum class complexity28.00
▷ Maximum class complexity28.00
Average method complexity4.86
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin