71% ogpanic

Code Review | OGPanic

WordPress plugin OGPanic scored71%from 54 tests.

About plugin

  • Plugin page: ogpanic
  • Plugin version: 1.0.14
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.1-5.3
  • WordPress version: 6.3.1
  • First release: Dec 20, 2019
  • Latest release: Jan 9, 2020
  • Number of updates: 31
  • Update frequency: every 0.7 days
  • Top authors: rakuraku (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,161 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.56ms] Passed 4 tests

Server-side resources used by OGPanic
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.33 ▼2.41
Dashboard /wp-admin3.31 ▲0.0044.70 ▼2.00
Posts /wp-admin/edit.php3.36 ▲0.0040.69 ▼10.22
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.47 ▼7.61
Media Library /wp-admin/upload.php3.23 ▲0.0033.97 ▼0.99
OGPanic /wp-admin/options-general.php?page=ogpanic/admin/partials/og-panic-admin-display.php3.0021.43

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 30 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
ogpanic_activated

Browser metrics Passed 4 tests

An overview of browser requirements for OGPanic
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.26 ▲0.041.75 ▲0.1942.74 ▼4.19
Dashboard /wp-admin2,192 ▲185.53 ▼0.0283.29 ▼3.0235.45 ▼3.72
Posts /wp-admin/edit.php2,100 ▼02.00 ▲0.0237.33 ▲2.3535.26 ▼0.56
Add New Post /wp-admin/post-new.php1,531 ▲323.17 ▲0.31699.27 ▲24.4358.75 ▲8.19
Media Library /wp-admin/upload.php1,400 ▼04.28 ▲0.1095.56 ▼20.1844.08 ▼3.60
OGPanic /wp-admin/options-general.php?page=ogpanic/admin/partials/og-panic-admin-display.php280.420.093.57

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • ogpanic_activated
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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 take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/ogpanic/public/partials/og-panic-public-display.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/ogpanic/admin/partials/og-panic-admin-display.php:18

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/options-general.php?page=ogpanic/admin/partials/og-panic-admin-display.php
    • > Network (severe)
    wp-admin/options-general.php?page=ogpanic/admin/partials/og-panic-admin-display.php - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 81% 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
Attributes that require attention:
  • Tags: Too many tags (21 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: Screenshot #1 (Choose an theme and you are ready to go.) image required
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === ogpanic === )
You can look at the official readme.txt

ogpanic/og-panic.php 85% from 13 tests

Analyzing the main PHP file in "OGPanic" version 1.0.14
Please make the necessary changes and fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("ogpanic.php" instead of "og-panic.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
Everything looks great! No dangerous files found in this plugin919 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP13139517561
JavaScript34171207
PO File24652122
CSS14427
JSON2002

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity6.57
▷ Minimum class complexity1.00
▷ Maximum class complexity32.00
Average method complexity1.91
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods36
▷ Static methods38.33%
▷ Public methods2775.00%
▷ Protected methods00.00%
▷ Private methods925.00%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.81MB with 0.64MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png826.47KB167.93KB▼ 79.68%