83% open-graph-protocol-framework

Code Review | Open Graph Protocol Framework

WordPress plugin Open Graph Protocol Framework scored83%from 54 tests.

About plugin

  • Plugin page: open-graph-protoc...
  • Plugin version: 1.8.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.1
  • WordPress version: 6.3.1
  • First release: Dec 21, 2012
  • Latest release: Jan 3, 2023
  • Number of updates: 57
  • Update frequency: every 64.3 days
  • Top authors: itthinx (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

4,000+ active /99,748 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
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▲0.35ms] Passed 4 tests

An overview of server-side resources used by Open Graph Protocol Framework
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0742.51 ▲2.53
Dashboard /wp-admin3.34 ▲0.0447.67 ▲2.78
Posts /wp-admin/edit.php3.45 ▲0.1053.39 ▲4.56
Add New Post /wp-admin/post-new.php5.92 ▲0.0386.48 ▼6.63
Media Library /wp-admin/upload.php3.26 ▲0.0338.36 ▲2.70

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Open Graph Protocol Framework
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲7713.62 ▼0.771.64 ▼0.1540.54 ▼6.34
Dashboard /wp-admin2,206 ▲155.84 ▲0.94108.08 ▼5.0437.21 ▼5.71
Posts /wp-admin/edit.php2,089 ▲32.04 ▲0.0435.65 ▲1.6432.50 ▼1.45
Add New Post /wp-admin/post-new.php1,533 ▼023.29 ▲0.07675.31 ▼36.4653.20 ▼3.25
Media Library /wp-admin/upload.php1,391 ▲34.16 ▼0.06107.03 ▲2.8848.42 ▲1.34

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

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 | 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
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      require_once(OPEN_GRAPH_PROTOCOL_CORE_LIB/class-open-graph-protocol-options.php): failed to open stream: No such file or directory in wp-content/plugins/open-graph-protocol-framework/lib/core/boot.php on line 22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/open-graph-protocol-framework/lib/core/class-open-graph-protocol-meta.php:31
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/open-graph-protocol-framework/open-graph-protocol-framework.php on line 115
    • > PHP Warning
      Use of undefined constant OPEN_GRAPH_PROTOCOL_CORE_LIB - assumed 'OPEN_GRAPH_PROTOCOL_CORE_LIB' (this will throw an Error in a future version of PHP) in wp-content/plugins/open-graph-protocol-framework/lib/core/boot.php on line 22
    • > PHP Fatal error
      require_once(): Failed opening required 'WP_PLUGIN_DIR/open-graph-protocol-framework/lib/core/boot.php' (include_path='.:/usr/share/php') in wp-content/plugins/open-graph-protocol-framework/open-graph-protocol-framework.php on line 133
    • > PHP Warning
      require_once(WP_PLUGIN_DIR/open-graph-protocol-framework/lib/core/boot.php): failed to open stream: No such file or directory in wp-content/plugins/open-graph-protocol-framework/open-graph-protocol-framework.php on line 133
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/open-graph-protocol-framework/lib/core/class-open-graph-protocol.php:31
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/open-graph-protocol-framework/open-graph-protocol-framework.php on line 83
    • > PHP Fatal error
      require_once(): Failed opening required 'OPEN_GRAPH_PROTOCOL_CORE_LIB/class-open-graph-protocol-options.php' (include_path='.:/usr/share/php') in wp-content/plugins/open-graph-protocol-framework/lib/core/boot.php on line 22
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/open-graph-protocol-framework/open-graph-protocol-framework.php on line 123

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: Add an image for screenshot #1 (Plugin info)
  • Tags: There are too many tags (19 tag instead of maximum 10)
The official readme.txt is a good inspiration

open-graph-protocol-framework/open-graph-protocol-framework.php 92% from 13 tests

The main PHP file in "Open Graph Protocol Framework" ver. 1.8.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Description: Keep the plugin description shorter than 140 characters (currently 193 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
Good job! No executable or dangerous file extensions detected403 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP658378403

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity19.75
▷ Minimum class complexity7.00
▷ Maximum class complexity35.00
Average method complexity3.88
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods26
▷ Static methods2492.31%
▷ Public methods2284.62%
▷ Protected methods00.00%
▷ Private methods415.38%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants1083.33%
▷ Class constants216.67%
▷ Public constants2100.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
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png8.42KB4.18KB▼ 50.32%