84% viber-sharing-button-for-jetpack

Code Review | Viber Sharing Button for Jetpack

WordPress plugin Viber Sharing Button for Jetpack scored 84% from 54 tests.

About plugin

  • Plugin page: viber-sharing-but...
  • Plugin version: 1.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.2
  • WordPress version: 6.3.1
  • First release: Sep 24, 2015
  • Latest release: Oct 9, 2015
  • Number of updates: 6
  • Update frequency: every 3.3 days
  • Top authors: valeriosza (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 2,742 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼3.06ms] Passed 4 tests

A check of server-side resources used by Viber Sharing Button for Jetpack
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0033.50 ▼7.89
Dashboard /wp-admin3.31 ▲0.0044.88 ▼5.88
Posts /wp-admin/edit.php3.36 ▲0.0048.44 ▲1.56
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.98 ▲5.27
Media Library /wp-admin/upload.php3.23 ▲0.0033.47 ▼0.02

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Viber Sharing Button for Jetpack
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.21 ▼1.214.46 ▲2.6240.55 ▼5.30
Dashboard /wp-admin2,209 ▲185.89 ▼0.0195.74 ▼4.8941.17 ▼7.07
Posts /wp-admin/edit.php2,089 ▼02.06 ▲0.0139.43 ▲6.2935.51 ▲2.52
Add New Post /wp-admin/post-new.php1,547 ▲2818.36 ▼4.88645.85 ▼38.6565.99 ▲14.45
Media Library /wp-admin/upload.php1,382 ▼34.19 ▼0.0295.72 ▼3.9341.44 ▼2.10

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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/viber-sharing-button-for-jetpack/includes/class.viber-source.php
    • > /wp-content/plugins/viber-sharing-button-for-jetpack/jetpack-viber.php
    • > /wp-content/plugins/viber-sharing-button-for-jetpack/includes/class.viber-service.php

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
10 plugin tags: viber sharing button for jetpack, social, viber, jetpack sharing, viber button for jetpack sharing...

viber-sharing-button-for-jetpack/jetpack-viber.php 85% from 13 tests

"Viber Sharing Button for Jetpack" version 1.1.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("viber-sharing-button-for-jetpack.php" instead of "jetpack-viber.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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 detected334 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP35222217
CSS111881
PO File191235
JavaScript1001

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity7.33
▷ Minimum class complexity4.00
▷ Maximum class complexity13.00
Average method complexity1.86
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods22
▷ Static methods418.18%
▷ Public methods2090.91%
▷ Protected methods00.00%
▷ Private methods29.09%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
10 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/shape-white.png1.30KB0.76KB▼ 41.15%
assets/images/rectangle-ja.png2.34KB0.90KB▼ 61.39%
assets/images/shape@2x.png1.98KB1.41KB▼ 28.80%
assets/images/shape.png1.58KB0.92KB▼ 41.87%
assets/images/rectangle-ja@2x.png4.01KB1.77KB▼ 55.93%