84% kn-mobile-sharebar

Code Review | KN Mobile ShareBar

WordPress plugin KN Mobile ShareBar scored84%from 54 tests.

About plugin

  • Plugin page: kn-mobile-sharebar
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.8.2
  • WordPress version: 6.3.1
  • First release: Feb 25, 2015
  • Latest release: Sep 28, 2017
  • Number of updates: 22
  • Update frequency: every 43.0 days
  • Top authors: KakiNetwork (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

600+ active /16,295 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.05MB] [CPU: ▲0.51ms] Passed 4 tests

A check of server-side resources used by KN Mobile ShareBar
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0542.53 ▲5.11
Dashboard /wp-admin3.36 ▲0.0544.18 ▼2.32
Posts /wp-admin/edit.php3.41 ▲0.0548.26 ▲4.43
Add New Post /wp-admin/post-new.php5.94 ▲0.0589.91 ▼0.15
Media Library /wp-admin/upload.php3.28 ▲0.0535.42 ▲0.07
KN Mobile Sharebar /wp-admin/options-general.php?page=kn_mobile_sharebar_settings3.2530.19

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 13 new files
Database: no new tables, 15 new options
New WordPress options
widget_recent-comments
kn_mobile_sharebar_visibility_homepage
can_compress_scripts
kn_mobile_sharebar_twitter
kn_mobile_sharebar_height
widget_theysaidso_widget
kn_mobile_sharebar_small_desktop
kn_mobile_sharebar_facebook
kn_mobile_sharebar_visibility_page
kn_mobile_sharebar_whatsapp
...

Browser metrics Passed 4 tests

A check of browser resources used by KN Mobile ShareBar
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲4913.26 ▼1.114.49 ▲2.6743.66 ▲3.42
Dashboard /wp-admin2,210 ▲215.80 ▼0.06101.46 ▼8.3841.74 ▼1.27
Posts /wp-admin/edit.php2,093 ▲12.05 ▲0.0540.06 ▲3.3734.55 ▲0.83
Add New Post /wp-admin/post-new.php1,536 ▼018.14 ▼5.06611.20 ▼45.8068.61 ▲5.30
Media Library /wp-admin/upload.php1,392 ▲14.20 ▼0.1295.46 ▼10.0644.11 ▼2.30
KN Mobile Sharebar /wp-admin/options-general.php?page=kn_mobile_sharebar_settings9972.2123.2135.62

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 15 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • kn_mobile_sharebar_visibility_homepage
    • kn_mobile_sharebar_where
    • kn_mobile_sharebar_visibility_page
    • kn_mobile_sharebar_whatsapp
    • db_upgraded
    • kn_mobile_sharebar_small_desktop
    • widget_theysaidso_widget
    • ...

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)
Even though everything seems fine, this is not 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
Please fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/kn-mobile-sharebar/kn_ects.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/kn-mobile-sharebar/kn_mobile_sharebar.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Demo in action), #2 (Setting page)
The official readme.txt is a good inspiration

kn-mobile-sharebar/kn_mobile_sharebar.php 92% from 13 tests

"KN Mobile ShareBar" version 1.1.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
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 ("kn-mobile-sharebar.php" instead of "kn_mobile_sharebar.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin296 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP22017200
CSS10196

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
6 PNG files occupy 0.28MB with 0.20MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png215.55KB100.01KB▼ 53.60%
images/facebook.png6.04KB2.17KB▼ 64.11%
images/blank.png3.10KB0.11KB▼ 96.38%
screenshot-2.png48.56KB15.63KB▼ 67.83%
images/twitter.png5.93KB1.90KB▼ 68.01%