84% ogp-plus

Code Review | Ogp Plus

WordPress plugin Ogp Plus scored84%from 54 tests.

About plugin

  • Plugin page: ogp-plus
  • Plugin version: 1.09
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4
  • WordPress version: 6.3.1
  • First release: Dec 19, 2019
  • Latest release: Oct 30, 2023
  • Number of updates: 29
  • Update frequency: every 48.7 days
  • Top authors: Katsushi Kawamori (100%)

Code review

54 tests

User reviews

1 review

Install metrics

600+ active /3,591 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

An overview of server-side resources used by Ogp Plus
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0155.35 ▲12.92
Dashboard /wp-admin3.31 ▲0.0150.99 ▼7.97
Posts /wp-admin/edit.php3.36 ▲0.0151.78 ▼1.90
Add New Post /wp-admin/post-new.php5.89 ▲0.0190.72 ▼23.79
Media Library /wp-admin/upload.php3.24 ▲0.0137.73 ▼2.47
Ogp Plus /wp-admin/options-general.php?page=ogpplus3.2342.25

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Ogp Plus: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲3214.72 ▲0.372.80 ▲0.7750.14 ▲2.83
Dashboard /wp-admin2,196 ▲195.50 ▼0.04102.28 ▼0.6344.02 ▼0.85
Posts /wp-admin/edit.php2,104 ▲12.02 ▲0.0441.85 ▼0.3036.68 ▼4.00
Add New Post /wp-admin/post-new.php1,529 ▲123.02 ▲1.68691.98 ▼26.6453.39 ▼9.52
Media Library /wp-admin/upload.php1,401 ▲14.24 ▲0.05105.39 ▼20.5951.19 ▼3.19
Ogp Plus /wp-admin/options-general.php?page=ogpplus1,1213.2664.8830.21

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

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
Everything seems fine, however 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
The following issues need your attention
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ogp-plus/lib/class-ogpplus.php:37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ogp-plus/lib/class-ogpplus.php:37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ogp-plus/lib/class-ogpplusadmin.php:36

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: x, ogp, facebook

ogp-plus/ogpplus.php 85% from 13 tests

The main PHP file in "Ogp Plus" ver. 1.09 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("ogp-plus.php" instead of "ogpplus.php")
  • Description: Make the plugin description longer than 10 characters (currently 9 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected382 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP461130331
JavaScript192051

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity28.00
▷ Minimum class complexity26.00
▷ Maximum class complexity30.00
Average method complexity6.40
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods770.00%
▷ Protected methods00.00%
▷ Private methods330.00%
Functions0
▷ Named functions00.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
No PNG files were detected