84% oz-canonical

Code Review | OZ Canonical

WordPress plugin OZ Canonical scored 84% from 54 tests.

About plugin

  • Plugin page: oz-canonical
  • Plugin version: 0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 6.3.1
  • First release: Nov 19, 2012
  • Latest release: Nov 24, 2012
  • Number of updates: 9
  • Update frequency: every 0.4 days
  • Top authors: Andon (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active / 4,039 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.00MB] [CPU: ▼4.44ms] Passed 4 tests

An overview of server-side resources used by OZ Canonical
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.38 ▼3.73
Dashboard /wp-admin3.31 ▲0.0150.67 ▼1.95
Posts /wp-admin/edit.php3.36 ▲0.0048.27 ▲2.89
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.94 ▼14.56
Media Library /wp-admin/upload.php3.23 ▲0.0038.51 ▲2.50

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for OZ Canonical
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,842 ▲10713.54 ▼0.831.81 ▲0.0140.95 ▼1.12
Dashboard /wp-admin2,219 ▲285.79 ▲0.9194.74 ▼15.5138.44 ▼5.37
Posts /wp-admin/edit.php2,105 ▲132.04 ▲0.0738.10 ▲1.3134.87 ▲2.73
Add New Post /wp-admin/post-new.php1,527 ▲317.75 ▼5.74651.83 ▼38.0966.73 ▲8.91
Media Library /wp-admin/upload.php1,404 ▲164.18 ▼0.0394.03 ▼8.9941.23 ▼4.56

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/oz-canonical/ozc.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Screenshot #1 (The OZ Canonical options screen, where you can add new canonical url for every page in your blog.) image required
Please take inspiration from this readme.txt

oz-canonical/ozc.php 92% from 13 tests

Analyzing the main PHP file in "OZ Canonical" version 0.5
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("oz-canonical.php" instead of "ozc.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin48 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP17848

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.13
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png22.71KB9.02KB▼ 60.27%