79% kehittamo-share-buttons

Code Review | Kehittämö Share Buttons

WordPress plugin Kehittämö Share Buttons scored 79% from 54 tests.

About plugin

  • Plugin page: kehittamo-share-b...
  • Plugin version: 0.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7.1
  • WordPress version: 6.3.1
  • First release: Aug 22, 2016
  • Latest release: Aug 22, 2016
  • Number of updates: 11
  • Update frequency: every 14.3 days
  • Top authors: kehittamo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 809 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.19MB] [CPU: ▲0.10ms] Passed 4 tests

An overview of server-side resources used by Kehittämö Share Buttons
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1942.02 ▲3.43
Dashboard /wp-admin3.49 ▲0.1946.70 ▼1.43
Posts /wp-admin/edit.php3.61 ▲0.2547.99 ▼2.96
Add New Post /wp-admin/post-new.php6.07 ▲0.19104.36 ▲11.05
Media Library /wp-admin/upload.php3.42 ▲0.1935.20 ▲1.37
Share Buttons /wp-admin/options-general.php?page=kehittamo-share-buttons-admin3.3631.15

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 193 new files
Database: no new tables, 7 new options
New WordPress options
kehittamo_share_buttons_settings
widget_theysaidso_widget
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Kehittämö Share Buttons
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,912 ▲17713.65 ▼0.746.16 ▲4.2243.12 ▼1.85
Dashboard /wp-admin2,207 ▲165.81 ▲0.74106.54 ▼13.4539.62 ▼5.43
Posts /wp-admin/edit.php2,093 ▲72.04 ▼0.0141.17 ▲0.0135.17 ▲0.81
Add New Post /wp-admin/post-new.php1,537 ▲1423.22 ▼0.04603.78 ▼76.9051.00 ▼5.63
Media Library /wp-admin/upload.php1,392 ▲44.17 ▼0.0394.68 ▼7.1342.78 ▼1.98
Share Buttons /wp-admin/options-general.php?page=kehittamo-share-buttons-admin9032.0523.5728.96

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • kehittamo_share_buttons_settings
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=kehittamo-share-buttons-admin
    • > Notice in wp-content/plugins/kehittamo-share-buttons/includes/kehittamo-share-buttons-admin.php+169
    Undefined index: kehittamo_share_buttons_fb_app_id
    • > GET request to /wp-admin/options-general.php?page=kehittamo-share-buttons-admin
    • > Notice in wp-content/plugins/kehittamo-share-buttons/includes/kehittamo-share-buttons-admin.php+179
    Undefined index: kehittamo_share_buttons_fb_app_secret

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
Please fix the following items
  • 93× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/kehittamo-share-buttons/vendor/facebook-php-sdk-v4-5.0.0/tests/Url/FacebookUrlDetectionHandlerTest.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\Tests\\HttpClients\\AbstractTestHttpClient' not found in wp-content/plugins/kehittamo-share-buttons/vendor/facebook-php-sdk-v4-5.0.0/tests/HttpClients/FacebookCurlHttpClientTest.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\GraphNodes\\GraphNode' not found in wp-content/plugins/kehittamo-share-buttons/vendor/facebook-php-sdk-v4-5.0.0/src/Facebook/GraphNodes/GraphApplication.php:32
    • > PHP Fatal error
      Uncaught Error: Interface 'Facebook\\PseudoRandomString\\PseudoRandomStringGeneratorInterface' not found in wp-content/plugins/kehittamo-share-buttons/vendor/facebook-php-sdk-v4-5.0.0/src/Facebook/PseudoRandomString/OpenSslPseudoRandomStringGenerator.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\GraphNodes\\GraphNode' not found in wp-content/plugins/kehittamo-share-buttons/vendor/facebook-php-sdk-v4-5.0.0/src/Facebook/GraphNodes/GraphSessionInfo.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/kehittamo-share-buttons/vendor/facebook-php-sdk-v4-5.0.0/tests/Http/GraphRawResponseTest.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\FacebookResponse' not found in wp-content/plugins/kehittamo-share-buttons/vendor/facebook-php-sdk-v4-5.0.0/src/Facebook/FacebookBatchResponse.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\GraphNodes\\GraphNode' not found in wp-content/plugins/kehittamo-share-buttons/vendor/facebook-php-sdk-v4-5.0.0/src/Facebook/GraphNodes/GraphCoverPhoto.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/kehittamo-share-buttons/vendor/facebook-php-sdk-v4-5.0.0/tests/Http/RequestBodyMultipartTest.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\Helpers\\FacebookSignedRequestFromInputHelper' not found in wp-content/plugins/kehittamo-share-buttons/vendor/facebook-php-sdk-v4-5.0.0/src/Facebook/Helpers/FacebookJavaScriptHelper.php:31

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: twitter, facebook, social media, whatsapp, share buttons

kehittamo-share-buttons/kehittamo-share-buttons.php Passed 13 tests

The primary PHP file in "Kehittämö Share Buttons" version 0.2.2 is used by WordPress to initiate all plugin functionality
55 characters long description:
Add Facebook, Twitter & Whatsapp share buttons to posts

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected9,671 lines of code in 145 files:
LanguageFilesBlank linesComment linesLines of code
PHP1201,8556,6058,963
Markdown3640232
CSS102647213
PO File2101229106
SVG40045
JSON10041
YAML27025
JavaScript21124
XML10022

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity3.98
▷ Minimum class complexity1.00
▷ Maximum class complexity36.00
Average method complexity1.48
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces23
Interfaces5
Traits1
Classes125
▷ Abstract classes32.40%
▷ Concrete classes12297.60%
▷ Final classes00.00%
Methods788
▷ Static methods121.52%
▷ Public methods74194.04%
▷ Protected methods263.30%
▷ Private methods212.66%
Functions9
▷ Named functions00.00%
▷ Anonymous functions9100.00%
Constants40
▷ Global constants1332.50%
▷ Class constants2767.50%
▷ Public constants27100.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 files were detected