84% custom-posts-order

Code Review | Custom Posts Order

WordPress plugin Custom Posts Order scored84%from 54 tests.

About plugin

  • Plugin page: custom-posts-order
  • Plugin version: 4.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.6
  • WordPress version: 6.3.1
  • First release: Sep 1, 2015
  • Latest release: Nov 24, 2020
  • Number of updates: 39
  • Update frequency: every 49.0 days
  • Top authors: hiren1612 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active /11,504 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼1.47ms] Passed 4 tests

An overview of server-side resources used by Custom Posts Order
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.31 ▼4.88
Dashboard /wp-admin3.31 ▲0.0146.39 ▲2.68
Posts /wp-admin/edit.php3.36 ▲0.0148.59 ▼2.30
Add New Post /wp-admin/post-new.php5.91 ▲0.0391.67 ▲0.05
Media Library /wp-admin/upload.php3.24 ▲0.0135.70 ▲1.24
Custom posts Order /wp-admin/options-general.php?page=addpostsection3.2031.33

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
porder_name
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Custom Posts Order: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲3913.24 ▼1.031.69 ▼0.3440.22 ▼4.23
Dashboard /wp-admin2,214 ▲294.88 ▼0.9498.87 ▼1.2139.23 ▼0.62
Posts /wp-admin/edit.php2,101 ▲152.26 ▲0.2439.85 ▼0.6336.64 ▼1.15
Add New Post /wp-admin/post-new.php1,538 ▲2418.63 ▲1.19585.99 ▼73.2051.93 ▼1.74
Media Library /wp-admin/upload.php1,399 ▲114.25 ▲0.0493.99 ▼3.8141.66 ▼3.69
Custom posts Order /wp-admin/options-general.php?page=addpostsection8201.9326.5330.75

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • porder_name
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

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
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
The following issues need your attention
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-posts-order/addpostsection.php:194
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-posts-order/addpostsection.php:194

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 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 17 tag instead of maximum 10
You can take inspiration from this readme.txt

custom-posts-order/custom_posts_order.php 92% from 13 tests

The main PHP script in "Custom Posts Order" version 4.4 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("custom-posts-order.php" instead of "custom_posts_order.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
Everything looks great! No dangerous files found in this plugin408 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP23644336
JavaScript14651
CSS20119
Markdown1002

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin