10% simple-open-graph

Code Review | Simple Open Graph

WordPress plugin Simple Open Graph scored10%from 54 tests.

About plugin

  • Plugin page: simple-open-graph
  • Plugin version: 2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.1
  • WordPress version: 6.3.1
  • First release: Jun 13, 2011
  • Latest release: Mar 6, 2015
  • Number of updates: 48
  • Update frequency: every 28.4 days
  • Top authors: PcFrk256 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /5,829 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/simple-open-graph/opengraph.php+149
    The each() function is deprecated. This message will be suppressed on further calls

Server metrics [RAM: ▼2.18MB] [CPU: ▼55.95ms] Passed 4 tests

Server-side resources used by Simple Open Graph
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.644.73 ▼40.42
Dashboard /wp-admin2.11 ▼1.466.15 ▼46.61
Posts /wp-admin/edit.php2.11 ▼1.575.54 ▼47.24
Add New Post /wp-admin/post-new.php2.11 ▼4.046.28 ▼89.51
Media Library /wp-admin/upload.php2.11 ▼1.385.32 ▼32.86
Open Graph /wp-admin/options-general.php?page=simpleopengraph2.116.42

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Simple Open Graph
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,803 ▲4214.34 ▼0.011.97 ▼0.0245.60 ▲1.07
Dashboard /wp-admin2,202 ▲255.65 ▼0.0487.25 ▼17.8039.47 ▼3.98
Posts /wp-admin/edit.php2,101 ▲12.04 ▲0.0435.26 ▼1.5532.94 ▼4.65
Add New Post /wp-admin/post-new.php1,557 ▲1218.30 ▼5.03632.44 ▼59.7861.93 ▲10.38
Media Library /wp-admin/upload.php1,404 ▲104.24 ▲0.0198.33 ▼2.9742.05 ▼1.57
Open Graph /wp-admin/options-general.php?page=simpleopengraph1,0353.0244.2228.80

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/simple-open-graph/opengraph.php+149
    The each() function is deprecated. This message will be suppressed on further calls
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=simpleopengraph
    • > Deprecated in wp-content/plugins/simple-open-graph/opengraph.php+149
    The each() function is deprecated. This message will be suppressed on further calls
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=simpleopengraph
    • > Notice in wp-content/plugins/simple-open-graph/simpleopengraph_options.php+81
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-open-graph/simpleopengraph_options.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-open-graph/simpleopengraph_options.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === simple-open-graph === )
The official readme.txt is a good inspiration

simple-open-graph/opengraph.php 92% from 13 tests

The primary PHP file in "Simple Open Graph" version 2.4 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("simple-open-graph.php" instead of "opengraph.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected222 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP31843199
JavaScript113423

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
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%
Functions20
▷ Named functions20100.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 were not PNG files found in your plugin