83% og

Code Review | OG — Better Share on Social Media

WordPress plugin OG — Better Share on Social Media scored83%from 54 tests.

About plugin

  • Plugin page: og
  • Plugin version: 3.2.6
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.4
  • WordPress version: 6.3.1
  • First release: Oct 2, 2014
  • Latest release: Dec 1, 2023
  • Number of updates: 228
  • Update frequency: every 14.7 days
  • Top authors: iworks (100%)

Code review

54 tests

User reviews

201 reviews

Install metrics

30,000+ active /581,059 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

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

A check of server-side resources used by OG — Better Share on Social Media
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0037.22 ▼3.37
Dashboard /wp-admin3.31 ▼0.0448.58 ▼15.49
Posts /wp-admin/edit.php3.36 ▲0.0049.19 ▼0.35
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.76 ▼9.96
Media Library /wp-admin/upload.php3.23 ▲0.0036.33 ▲4.70

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

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

Browser metrics Passed 4 tests

A check of browser resources used by OG — Better Share on Social Media
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲4314.16 ▼0.241.78 ▲0.0341.05 ▼2.62
Dashboard /wp-admin2,198 ▲245.65 ▲0.1296.25 ▼8.0642.30 ▼0.23
Posts /wp-admin/edit.php2,100 ▼01.95 ▲0.0139.75 ▼0.0834.43 ▼1.21
Add New Post /wp-admin/post-new.php1,526 ▼923.31 ▼2.06669.90 ▲11.4253.76 ▼8.64
Media Library /wp-admin/upload.php1,394 ▼64.21 ▼0.0798.10 ▲1.3041.00 ▼1.68

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 9× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'iWorks_OpenGraph_Integrations' not found in wp-content/plugins/og/includes/iworks/opengraph/integrations/class-iworks-opengraph-integrations-sitepress-multilingual-cms.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'iWorks_OpenGraph_Integrations' not found in wp-content/plugins/og/includes/iworks/opengraph/integrations/class-iworks-opengraph-integrations-contextual-related-posts.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'iWorks_OpenGraph_Integrations' not found in wp-content/plugins/og/includes/iworks/opengraph/integrations/class-iworks-opengraph-integrations-reading-time-wp.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'iWorks_OpenGraph_Integrations' not found in wp-content/plugins/og/includes/iworks/opengraph/integrations/class-iworks-opengraph-integrations-post-expirator.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/og/includes/iworks/class-iworks-opengraph.php:49
    • > PHP Fatal error
      Uncaught Error: Class 'iWorks_OpenGraph_Integrations' not found in wp-content/plugins/og/includes/iworks/opengraph/integrations/class-iworks-opengraph-integrations-related-posts-for-wp.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'iWorks_OpenGraph_Integrations' not found in wp-content/plugins/og/includes/iworks/opengraph/integrations/class-iworks-opengraph-integrations-yarpp.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'iWorks_OpenGraph_Integrations' not found in wp-content/plugins/og/includes/iworks/opengraph/integrations/class-iworks-opengraph-integrations-categories-images.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'iWorks_OpenGraph_Integrations' not found in wp-content/plugins/og/includes/iworks/opengraph/integrations/class-iworks-opengraph-integrations-twitter.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
The official readme.txt is a good inspiration

og/og.php 92% from 13 tests

This is the main PHP file of "OG — Better Share on Social Media" version 3.2.6, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Description: The description should be shorter than 140 characters (currently 164 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin2,009 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP171039121,745
Sass180138
CSS151101
JavaScript10024
SVG1001

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 135)
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity32.27
▷ Minimum class complexity3.00
▷ Maximum class complexity248.00
Average method complexity5.85
▷ Minimum method complexity1.00
▷ Maximum method complexity135.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes19.09%
▷ Concrete classes1090.91%
▷ Final classes00.00%
Methods71
▷ Static methods11.41%
▷ Public methods4766.20%
▷ Protected methods45.63%
▷ Private methods2028.17%
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

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/logo.png16.73KB9.05KB▼ 45.91%