78% social-photo-blocks

Code Review | Social Photo Blocks

WordPress plugin Social Photo Blocks scored 78% from 54 tests.

About plugin

  • Plugin page: social-photo-blocks
  • Plugin version: 1.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0.1
  • WordPress version: 6.3.1
  • First release: Mar 4, 2020
  • Latest release: Aug 28, 2022
  • Number of updates: 6
  • Update frequency: every 153.5 days
  • Top authors: dzysyak (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 477 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.04MB] [CPU: ▼8.07ms] Passed 4 tests

Analyzing server-side resources used by Social Photo Blocks
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0536.63 ▼5.33
Dashboard /wp-admin3.35 ▲0.0544.22 ▼1.69
Posts /wp-admin/edit.php3.46 ▲0.1146.07 ▼3.50
Add New Post /wp-admin/post-new.php5.89 ▲0.0094.45 ▼21.75
Media Library /wp-admin/upload.php3.27 ▲0.0435.91 ▲2.07
Social photo blocks /wp-admin/options-general.php?page=Social_Photo_Blocks3.2432.27

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 8 new files
Database: no new tables, 8 new options
New WordPress options
widget_social_photo_slide_widget
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_social_photo_grid_widget
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Social Photo Blocks
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲9713.25 ▼1.341.74 ▼0.1441.88 ▼6.89
Dashboard /wp-admin2,212 ▲216.01 ▲1.1093.21 ▼5.9539.81 ▼2.58
Posts /wp-admin/edit.php2,095 ▲32.01 ▼0.0139.86 ▼4.1534.89 ▼6.88
Add New Post /wp-admin/post-new.php6,593 ▲5,06529.46 ▲11.45880.73 ▲273.8236.70 ▼20.41
Media Library /wp-admin/upload.php1,397 ▲64.17 ▼0.0395.70 ▼3.2941.16 ▼2.28
Social photo blocks /wp-admin/options-general.php?page=Social_Photo_Blocks8352.0628.4136.40

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_social_photo_slide_widget
    • theysaidso_admin_options
    • widget_social_photo_grid_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 4× PHP files output text when accessed directly:
    • > /wp-content/plugins/social-photo-blocks/tpl/recent_slider.php
    • > /wp-content/plugins/social-photo-blocks/oauth_redirect.php
    • > /wp-content/plugins/social-photo-blocks/social-photo-blocks.php
    • > /wp-content/plugins/social-photo-blocks/tpl/recent_basic.php
  • 28× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/social-photo-blocks/tpl/recent_slider.php on line 1
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/social-photo-blocks/tpl/recent_basic.php on line 1
    • > PHP Notice
      Undefined index: code in wp-content/plugins/social-photo-blocks/oauth_redirect.php on line 3
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/social-photo-blocks/tpl/recent_basic.php on line 3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/social-photo-blocks/tpl/recent_slider.php on line 1
    • > PHP Notice
      Undefined variable: cfg in wp-content/plugins/social-photo-blocks/tpl/recent_slider.php on line 1
    • > PHP Notice
      Undefined variable: cfg in wp-content/plugins/social-photo-blocks/tpl/recent_basic.php on line 1
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/social-photo-blocks/tpl/recent_basic.php on line 1
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/social-photo-blocks/tpl/recent_slider.php on line 1
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/social-photo-blocks/tpl/recent_slider.php on line 1

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 97% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 14 tag instead of maximum 10
The official readme.txt might help

social-photo-blocks/social-photo-blocks.php Passed 13 tests

"Social Photo Blocks" version 1.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
95 characters long description:
Plugin provides gutenberg block, shortcode & widget of recent photos from your social accounts.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected938 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP4127149554
JavaScript2199281
CSS1256103

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity23.33
▷ Minimum class complexity8.00
▷ Maximum class complexity42.00
Average method complexity3.48
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods27
▷ Static methods13.70%
▷ Public methods2488.89%
▷ Protected methods00.00%
▷ Private methods311.11%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin