84% auto-social-media-screenshot-preview

Code Review | Auto Social-Media Screenshot Preview

WordPress plugin Auto Social-Media Screenshot Preview scored84%from 54 tests.

About plugin

  • Plugin page: auto-social-media...
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.8.1
  • WordPress version: 6.3.1
  • First release: Oct 2, 2021
  • Latest release: Oct 2, 2021
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: kobosil (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /344 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
Install script ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▲0.78ms] Passed 4 tests

Server-side resources used by Auto Social-Media Screenshot Preview
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0637.73 ▲0.99
Dashboard /wp-admin3.37 ▲0.0751.97 ▼0.42
Posts /wp-admin/edit.php3.48 ▲0.1348.26 ▲2.29
Add New Post /wp-admin/post-new.php5.95 ▲0.0690.61 ▲0.68
Media Library /wp-admin/upload.php3.29 ▲0.0634.77 ▲1.85

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Auto Social-Media Screenshot Preview
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲7013.55 ▼0.831.84 ▼0.2842.50 ▲0.62
Dashboard /wp-admin2,219 ▲315.83 ▲0.95100.79 ▼16.4537.51 ▼6.81
Posts /wp-admin/edit.php2,102 ▲132.01 ▼0.0439.51 ▲5.3334.23 ▼1.31
Add New Post /wp-admin/post-new.php1,553 ▲3423.28 ▼0.14640.77 ▼31.3050.20 ▼8.83
Media Library /wp-admin/upload.php1,404 ▲164.21 ▲0.0196.69 ▼5.6441.33 ▼6.21

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

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)
Everything seems fine, however this is by no means an exhaustive test

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
Please take a closer look at the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/auto-social-media-screenshot-preview/public/partials/plugin-screenshot-preview-display.php
    • > /wp-content/plugins/auto-social-media-screenshot-preview/admin/partials/screenshot-preview-admin-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
6 plugin tags: screenshot preview, preview thumbnails, live screenshot, social media screenshot, open graph preview...

auto-social-media-screenshot-preview/screenshot-preview.php 85% from 13 tests

The entry point to "Auto Social-Media Screenshot Preview" version 1.0.4 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("auto-social-media-screenshot-preview.php" instead of "screenshot-preview.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected231 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP12117478231

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity2.00
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods28
▷ Static methods27.14%
▷ Public methods2382.14%
▷ Protected methods00.00%
▷ Private methods517.86%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.22MB with 0.07MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-256x256.png30.76KB12.21KB▼ 60.29%
assets/screenshot-1.png190.06KB204.56KB0.00%