84% social-share-image

Code Review | Social Share Image

WordPress plugin Social Share Image scored84%from 54 tests.

About plugin

  • Plugin page: social-share-image
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0.1
  • WordPress version: 6.3.1
  • First release: Jul 24, 2022
  • Latest release: Aug 19, 2022
  • Number of updates: 6
  • Update frequency: every 4.7 days
  • Top authors: biliplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /288 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.99ms] Passed 4 tests

Server-side resources used by Social Share Image
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0333.89 ▼4.01
Dashboard /wp-admin3.32 ▲0.0244.21 ▼1.08
Posts /wp-admin/edit.php3.38 ▲0.0247.65 ▼3.18
Add New Post /wp-admin/post-new.php5.93 ▲0.0490.44 ▼3.67
Media Library /wp-admin/upload.php3.25 ▲0.0238.35 ▲4.23

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

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

Browser metrics Passed 4 tests

Social Share Image: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲7513.30 ▼1.101.64 ▼0.0339.84 ▼3.45
Dashboard /wp-admin2,224 ▲364.90 ▼0.96102.87 ▼2.9837.34 ▼5.83
Posts /wp-admin/edit.php2,110 ▲212.05 ▲0.0839.34 ▼2.5633.94 ▼1.40
Add New Post /wp-admin/post-new.php6,373 ▲4,84526.15 ▲7.91927.60 ▲314.6348.49 ▼13.32
Media Library /wp-admin/upload.php1,403 ▲184.16 ▼0.02109.50 ▲9.3445.79 ▲3.54

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

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_query_var() in wp-content/plugins/social-share-image/templates/template-loader.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/social-share-image/social-share-image.php:31

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 Passed 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
4 plugin tags: image, social share image, open graph, social image

social-share-image/social-share-image.php Passed 13 tests

This is the main PHP file of "Social Share Image" version 1.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
33 characters long description:
Create Custom Scoial Share Image.

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 detected1,130 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript410746639
PHP460121421
CSS28070

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.30
Average class complexity16.00
▷ Minimum class complexity10.00
▷ Maximum class complexity22.00
Average method complexity3.33
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions233.33%
▷ Anonymous functions466.67%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.18MB with 0.12MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png98.46KB34.70KB▼ 64.76%
screenshot-1.png84.86KB30.07KB▼ 64.57%