72% selected-categories-post-ordering

Code Review | Selected Categories Post Ordering

WordPress plugin Selected Categories Post Orderingscored72%from 54 tests.

About plugin

  • Plugin page: selected-categori...
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.5.1
  • WordPress version: 6.3.1
  • First release: Sep 15, 2020
  • Latest release: Sep 20, 2020
  • Number of updates: 11
  • Update frequency: every 1.6 days
  • Top authors: thevirajshelke (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /397 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼7.92ms] Passed 4 tests

Analyzing server-side resources used by Selected Categories Post Ordering
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.0741.15 ▼4.28
Dashboard /wp-admin3.42 ▲0.0352.04 ▼12.72
Posts /wp-admin/edit.php3.53 ▲0.1355.95 ▲1.46
Add New Post /wp-admin/post-new.php6.02 ▲0.0990.51 ▼16.14
Media Library /wp-admin/upload.php3.35 ▲0.0743.51 ▲4.32
Selected Categories Post Ordering /wp-admin/options-general.php?page=selected-categories-post-ordering3.3138.85

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 22 new files
Database: no new tables, 7 new options
New WordPress options
scpo_options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Selected Categories Post Ordering
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,905 ▲15913.44 ▼1.098.20 ▲6.6545.82 ▲1.83
Dashboard /wp-admin2,203 ▲355.62 ▼0.0688.88 ▼1.4640.26 ▼3.14
Posts /wp-admin/edit.php2,111 ▲81.97 ▼0.0134.64 ▼8.0935.24 ▼2.64
Add New Post /wp-admin/post-new.php1,533 ▲1623.00 ▲4.34685.89 ▲164.4057.06 ▲1.94
Media Library /wp-admin/upload.php1,408 ▲54.25 ▲0.05111.59 ▲11.8346.04 ▼0.83
Selected Categories Post Ordering /wp-admin/options-general.php?page=selected-categories-post-ordering7982.0324.7927.98

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=selected-categories-post-ordering
    • > Warning in wp-content/plugins/selected-categories-post-ordering/admin/class-selected-categories-post-ordering-admin.php+182
    Illegal string offset 'uncategorized'
    • > GET request to /wp-admin/options-general.php?page=selected-categories-post-ordering
    • > Notice in wp-content/plugins/selected-categories-post-ordering/admin/class-selected-categories-post-ordering-admin.php+182
    Uninitialized string offset: 0
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=selected-categories-post-ordering
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=selected-categories-post-ordering
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(http://www.fillyourtaproom.com/wp-json/wp/v2/posts?per_page=10): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/selected-categories-post-ordering/public/partials/selected-categories-post-ordering-public-display.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/selected-categories-post-ordering/admin/partials/selected-categories-post-ordering-admin-display.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were 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
Attributes that need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === Selected Categories Post Ordering=== )
The official readme.txt is a good inspiration

selected-categories-post-ordering/selected-categories-post-ordering.php 92% from 13 tests

The main PHP file in "Selected Categories Post Ordering" ver. 1.1.1 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 143 characters long)

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
No dangerous file extensions were detected276 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12113570270
JavaScript24546
CSS2080

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity2.57
▷ Minimum class complexity1.00
▷ Maximum class complexity8.00
Average method complexity1.37
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods30
▷ Static methods26.67%
▷ Public methods2583.33%
▷ Protected methods00.00%
▷ Private methods516.67%
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

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin