83% simple-social-media-preview

Code Review | Simple Social Media Preview

WordPress plugin Simple Social Media Preview scored83%from 54 tests.

About plugin

  • Plugin page: simple-social-med...
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.1.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.9
  • WordPress version: 6.3.1
  • First release: Mar 3, 2022
  • Latest release: Mar 4, 2022
  • Number of updates: 3
  • Update frequency: every 1.0 days
  • Top authors: viktorfa (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /367 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.88MB] [CPU: ▲4.28ms] Passed 4 tests

A check of server-side resources used by Simple Social Media Preview
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.43 ▲1.9351.62 ▲6.43
Dashboard /wp-admin5.26 ▲1.9262.43 ▲11.76
Posts /wp-admin/edit.php5.31 ▲1.9159.35 ▼9.61
Add New Post /wp-admin/post-new.php7.78 ▲1.85103.23 ▲8.55
Media Library /wp-admin/upload.php5.12 ▲1.8553.35 ▲16.67
Simple Social Media Preview /wp-admin/options-general.php?page=sharizard-wordpress-settings5.0942.86

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 833 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
sharizard_wordpress__text_color
sharizard_wordpress__background_color
widget_theysaidso_widget
db_upgraded
widget_recent-comments
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Simple Social Media Preview: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,803 ▲5314.34 ▼0.211.62 ▼0.1038.26 ▼5.26
Dashboard /wp-admin2,193 ▲195.49 ▼0.0985.28 ▼7.9742.16 ▼5.90
Posts /wp-admin/edit.php2,104 ▲11.98 ▲0.0240.83 ▲3.2236.26 ▲0.37
Add New Post /wp-admin/post-new.php1,531 ▲423.35 ▲0.02656.13 ▼25.7048.81 ▼11.96
Media Library /wp-admin/upload.php1,404 ▲44.25 ▲0.1496.95 ▼10.2741.17 ▼5.25
Simple Social Media Preview /wp-admin/options-general.php?page=sharizard-wordpress-settings7992.0024.6926.54

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • sharizard_wordpress__background_color
    • widget_recent-posts
    • sharizard_wordpress__text_color

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 153× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Polyfill\\Intl\\Icu\\DateFormat\\Transformer' not found in wp-content/plugins/simple-social-media-preview/vendor/symfony/polyfill/src/Intl/Icu/DateFormat/QuarterTransformer.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'phpDocumentor\\Reflection\\Types\\Boolean' not found in wp-content/plugins/simple-social-media-preview/vendor/phpdocumentor/type-resolver/src/PseudoTypes/False_.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'phpDocumentor\\Reflection\\Types\\AbstractList' not found in wp-content/plugins/simple-social-media-preview/vendor/phpdocumentor/type-resolver/src/Types/Iterable_.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Arrayy\\Collection\\Collection' not found in wp-content/plugins/simple-social-media-preview/vendor/voku/arrayy/src/Type/DetectFirstValueTypeCollection.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'phpDocumentor\\Reflection\\Types\\Integer' not found in wp-content/plugins/simple-social-media-preview/vendor/phpdocumentor/type-resolver/src/PseudoTypes/PositiveInteger.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'phpDocumentor\\Reflection\\DocBlock\\Tags\\BaseTag' not found in wp-content/plugins/simple-social-media-preview/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Uses.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'Defuse\\Crypto\\Crypto' not found in wp-content/plugins/simple-social-media-preview/vendor/defuse/php-encryption/src/RuntimeTests.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'phpDocumentor\\Reflection\\Type' not found in wp-content/plugins/simple-social-media-preview/vendor/phpdocumentor/type-resolver/src/Types/Callable_.php:23
    • > PHP Fatal error
      Uncaught UnexpectedValueException: creating archive "wp-content/plugins/simple-social-media-preview/vendor/paragonie/random_compat/dist/random_compat.phar" disabled by the php.ini setting phar.readonly in /var/www/wordpress/wp-content/plugins/simple-social-media-preview/vendor/paragonie/random_compat/other/build_phar.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'phpDocumentor\\Reflection\\Types\\String_' not found in wp-content/plugins/simple-social-media-preview/vendor/phpdocumentor/type-resolver/src/PseudoTypes/NumericString.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
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
5 plugin tags: open graph, preview, share, image, social media

simple-social-media-preview/sharizard-wordpress.php 85% from 13 tests

"Simple Social Media Preview" version 1.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("simple-social-media-preview.php" instead of "sharizard-wordpress.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin123,042 lines of code in 702 files:
LanguageFilesBlank linesComment linesLines of code
PHP5628,53228,38695,719
Markdown575,873515,677
PO File252,1332,9137,108
JSON36002,582
JavaScript92521721,243
CSS6190271555
XML4151286
YAML14043
make19426
Bourne Shell1203

PHP code 0% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 1,480)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity20.85
▷ Minimum class complexity1.00
▷ Maximum class complexity1,480.00
Average method complexity3.36
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces50
Interfaces17
Traits1
Classes256
▷ Abstract classes155.86%
▷ Concrete classes24194.14%
▷ Final classes12049.79%
Methods2,312
▷ Static methods96241.61%
▷ Public methods2,02587.59%
▷ Protected methods652.81%
▷ Private methods2229.60%
Functions249
▷ Named functions15261.04%
▷ Anonymous functions9738.96%
Constants427
▷ Global constants7016.39%
▷ Class constants35783.61%
▷ Public constants34696.92%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
src/Admin/images/fake-logo.png4.67KB4.86KB0.00%