84% only-one-category

Code Review | Only One Category

WordPress plugin Only One Category scored84%from 54 tests.

About plugin

  • Plugin page: only-one-category
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-4.4.1
  • WordPress version: 6.3.1
  • First release: Jul 23, 2013
  • Latest release: Feb 26, 2016
  • Number of updates: 23
  • Update frequency: every 41.2 days
  • Top authors: pressupinc (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

400+ active /8,857 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
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.44ms] Passed 4 tests

Server-side resources used by Only One Category
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0133.92 ▼9.53
Dashboard /wp-admin3.31 ▲0.0145.55 ▲0.74
Posts /wp-admin/edit.php3.41 ▲0.0648.34 ▼2.44
Add New Post /wp-admin/post-new.php6.05 ▲0.1793.09 ▼2.01
Media Library /wp-admin/upload.php3.23 ▲0.0132.11 ▼3.78

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Only One Category
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.22 ▼1.531.79 ▼0.0540.18 ▼5.72
Dashboard /wp-admin2,206 ▲185.91 ▲0.99108.29 ▼9.9042.69 ▼1.24
Posts /wp-admin/edit.php2,094 ▲52.02 ▲0.0439.93 ▲1.9735.18 ▼1.12
Add New Post /wp-admin/post-new.php1,514 ▼1923.39 ▼0.06592.34 ▼86.2151.17 ▲5.88
Media Library /wp-admin/upload.php1,382 ▼94.21 ▲0.0294.20 ▼4.5741.56 ▼4.08

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× 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/only-one-category/main.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (How it'll make the Categories section look while editing a post on the current version of WordPress.), #2 (How it looks when you Quick Edit a post with the new UI.)
The official readme.txt might help

only-one-category/main.php 92% from 13 tests

Analyzing the main PHP file in "Only One Category" version 1.0.4
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("only-one-category.php" instead of "main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected49 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1101027
JavaScript1121322

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.60
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%
Functions3
▷ Named functions3100.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
2 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png24.74KB7.72KB▼ 68.81%
screenshot-1.png21.54KB5.77KB▼ 73.20%