84% ogp-generator

Code Review | OGP Generator

WordPress plugin OGP Generator scored84%from 54 tests.

About plugin

  • Plugin page: ogp-generator
  • Plugin version: 0.5.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.4
  • WordPress version: 6.3.1
  • First release: Sep 15, 2014
  • Latest release: Dec 10, 2015
  • Number of updates: 17
  • Update frequency: every 26.7 days
  • Top authors: ShinichiN (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,766 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼2.72ms] Passed 4 tests

Server-side resources used by OGP Generator
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0342.59 ▲0.53
Dashboard /wp-admin3.35 ▲0.0449.44 ▼5.38
Posts /wp-admin/edit.php3.40 ▲0.0447.56 ▼2.60
Add New Post /wp-admin/post-new.php5.93 ▲0.0487.49 ▼3.43
Media Library /wp-admin/upload.php3.27 ▲0.0437.35 ▲2.23

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by OGP Generator
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲6813.13 ▼1.171.95 ▲0.1337.34 ▼5.57
Dashboard /wp-admin2,206 ▲185.80 ▲0.9295.34 ▼22.4539.75 ▼4.95
Posts /wp-admin/edit.php2,089 ▼02.00 ▲0.0135.10 ▼1.0333.03 ▼0.72
Add New Post /wp-admin/post-new.php1,536 ▼223.32 ▲0.03631.21 ▼37.3356.33 ▼3.85
Media Library /wp-admin/upload.php1,385 ▼64.23 ▼0.0295.59 ▼3.8141.11 ▼2.06

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 were found after uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
Please take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/ogp-generator/nskw-ogp-generator.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ogp-generator/inc/output.php:3

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: ogp, facebook, open graph tag

ogp-generator/nskw-ogp-generator.php 92% from 13 tests

"OGP Generator" version 0.5.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("ogp-generator.php" instead of "nskw-ogp-generator.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
There were no executable files found in this plugin257 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP35032206
PO File1111451

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.44
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%
Functions9
▷ Named functions9100.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
There are no PNG files in this plugin