78% branded-social-images

Code Review | Branded Social Images - Open Graph Images with logo and extra text layer

WordPress plugin Branded Social Images - Open Graph Images with logo and extra text layer scored78%from 54 tests.

About plugin

  • Plugin page: branded-social-im...
  • Plugin version: 1.1.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2.2
  • WordPress version: 6.3.1
  • First release: Oct 16, 2021
  • Latest release: Jul 26, 2023
  • Number of updates: 60
  • Update frequency: every 10.8 days
  • Top authors: clearsite (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

800+ active /7,161 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.76MB] [CPU: ▲16.33ms] Passed 4 tests

A check of server-side resources used by Branded Social Images - Open Graph Images with logo and extra text layer
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.25 ▲0.7852.51 ▲17.20
Dashboard /wp-admin4.08 ▲0.7758.16 ▲9.79
Posts /wp-admin/edit.php4.14 ▲0.7763.46 ▲18.20
Add New Post /wp-admin/post-new.php6.81 ▲0.91132.25 ▲40.12
Media Library /wp-admin/upload.php3.94 ▲0.7152.36 ▲20.14

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 99 new files
Database: no new tables, 9 new options
New WordPress options
_bsi_image__og_logo_errors
_bsi_rewrite_rules_based_on
widget_recent-posts
can_compress_scripts
widget_recent-comments
_bsi_default__admin_errors
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Branded Social Images - Open Graph Images with logo and extra text layer
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,895 ▲14914.24 ▼0.291.98 ▲0.2944.64 ▲4.06
Dashboard /wp-admin2,277 ▲975.66 ▲0.0684.32 ▼3.8676.05 ▲27.68
Posts /wp-admin/edit.php2,196 ▲962.21 ▲0.2437.68 ▲2.4333.59 ▼1.50
Add New Post /wp-admin/post-new.php6,660 ▲5,12527.83 ▲9.441,011.94 ▲366.8884.07 ▲14.23
Media Library /wp-admin/upload.php1,494 ▲944.41 ▲0.3293.91 ▼5.3482.87 ▲39.35

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 9 options
    • widget_recent-comments
    • _bsi_rewrite_rules_based_on
    • db_upgraded
    • theysaidso_admin_options
    • _bsi_image__og_logo_errors
    • _bsi_default__admin_errors
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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 fix the following items
  • 20× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/branded-social-images/lib/html_inputs/class.select.php
    • > /wp-content/plugins/branded-social-images/lib/class.og-image-plugin.php
    • > /wp-content/plugins/branded-social-images/lib/html_inputs/class.input.php
    • > /wp-content/plugins/branded-social-images/lib/html_inputs/class.option.php
    • > /wp-content/plugins/branded-social-images/lib/class.og-image-imagick.php
    • > /wp-content/plugins/branded-social-images/lib/html_inputs/class.radio.php
    • > /wp-content/plugins/branded-social-images/lib/html_inputs/class.radios.php
    • > /wp-content/plugins/branded-social-images/lib/html_inputs/class.color.php
    • > /wp-content/plugins/branded-social-images/lib/class.og-image-gd.php
    • > /wp-content/plugins/branded-social-images/lib/html_inputs/class.textarea.php
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/branded-social-images/vendor/stil/gd-text/tests/TestCase.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'GDText\\Tests\\TestCase' not found in wp-content/plugins/branded-social-images/vendor/stil/gd-text/tests/TextWrappingTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'GDText\\Tests\\TestCase' not found in wp-content/plugins/branded-social-images/vendor/stil/gd-text/tests/TextAlignmentTest.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'GDText\\Tests\\TestCase' not found in wp-content/plugins/branded-social-images/vendor/stil/gd-text/tests/ColorTest.php:6

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 errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Tags: There are too many tags (11 tag instead of maximum 10)
You can look at the official readme.txt

branded-social-images/wp-plugin.php 85% from 13 tests

"Branded Social Images - Open Graph Images with logo and extra text layer" version 1.1.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 143 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("branded-social-images.php" instead of "wp-plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin8,556 lines of code in 56 files:
LanguageFilesBlank linesComment linesLines of code
PHP409381,1494,713
CSS20431,968
JavaScript2194821,278
PO File1116127294
Markdown1410120
JSON30075
SVG50060
Bourne Shell117341
XML1007

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity25.48
▷ Minimum class complexity1.00
▷ Maximum class complexity309.00
Average method complexity3.72
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces7
Interfaces0
Traits0
Classes31
▷ Abstract classes39.68%
▷ Concrete classes2890.32%
▷ Final classes00.00%
Methods244
▷ Static methods10442.62%
▷ Public methods21186.48%
▷ Protected methods114.51%
▷ Private methods229.02%
Functions30
▷ Named functions26.67%
▷ Anonymous functions2893.33%
Constants40
▷ Global constants25.00%
▷ Class constants3895.00%
▷ Public constants38100.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
28 PNG files occupy 0.21MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/stil/gd-text/tests/images/test_align_top_center.png9.20KB4.20KB▼ 54.29%
admin/images/ui-icons_2e83ff_256x240.png4.49KB4.18KB▼ 6.89%
admin/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.31KB0.18KB▼ 42.95%
vendor/stil/gd-text/examples/fonts.png53.05KB19.26KB▼ 63.70%
vendor/stil/gd-text/tests/images/test_align_top_left.png9.84KB4.50KB▼ 54.31%