84% np-social-share-counter

Code Review | Free Social Share Counter Plugin For WordPress - NP Social Share Counter

WordPress plugin Free Social Share Counter Plugin For WordPress - NP Social Share Counter scored84%from 54 tests.

About plugin

  • Plugin page: np-social-share-c...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-4.9.2
  • WordPress version: 6.3.1
  • First release: Mar 18, 2018
  • Latest release: Mar 18, 2018
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: supazthemes (100%)Otto42 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

20+ active /1,330 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.29MB] [CPU: ▲229.20ms] 75% from 4 tests

An overview of server-side resources used by Free Social Share Counter Plugin For WordPress - NP Social Share Counter
Please have a look at the following items
  • Extra CPU: Extra CPU usage must be kept under 200.00ms (currently 229.20ms on /wp-admin/upload.php)
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.181,449.70 ▲1,406.47
Dashboard /wp-admin3.33 ▲0.0356.04 ▲9.35
Posts /wp-admin/edit.php3.39 ▲0.0340.89 ▼3.37
Add New Post /wp-admin/post-new.php4.62 ▼1.271,001.62 ▲906.45
Media Library /wp-admin/upload.php3.25 ▲0.0336.08 ▲4.37

Server storage [IO: ▲2.31MB] [DB: ▲0.08MB] Passed 3 tests

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Free Social Share Counter Plugin For WordPress - NP Social Share Counter
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,988 ▲24215.20 ▲0.8214.97 ▲13.2851.72 ▲9.83
Dashboard /wp-admin2,261 ▲735.47 ▼0.43131.68 ▲17.7348.87 ▼0.75
Posts /wp-admin/edit.php2,163 ▲742.61 ▲0.5948.14 ▲7.2031.72 ▼4.57
Add New Post /wp-admin/post-new.php6,492 ▲4,95520.47 ▼2.861,064.76 ▲407.5544.46 ▼10.11
Media Library /wp-admin/upload.php1,451 ▲604.81 ▲0.63120.49 ▲19.9646.56 ▲1.63

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • npsc_settings
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 28× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/np-social-share-counter/admin/partials/np-social-share-counter-admin-display.php
    • > /wp-content/plugins/np-social-share-counter/public/partials/shortcodes/counter-shortcode.php
    • > /wp-content/plugins/np-social-share-counter/admin/partials/tabs/social-settings.php
    • > /wp-content/plugins/np-social-share-counter/public/partials/shortcodes/share-shortcode.php
    • > /wp-content/plugins/np-social-share-counter/includes/class-np-social-share-counter.php
    • > /wp-content/plugins/np-social-share-counter/public/partials/shortcodes/share-count-shortcode.php
    • > /wp-content/plugins/np-social-share-counter/admin/partials/tabs/social-counter-settings/counter-settings.php
    • > /wp-content/plugins/np-social-share-counter/public/partials/np-social-share-counter-public-display.php
    • > /wp-content/plugins/np-social-share-counter/includes/np-counter.php
    • > /wp-content/plugins/np-social-share-counter/admin/partials/class-np-social-share-counter-admin-settings.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: counter, social media, wordpress social share, social, social counter...

np-social-share-counter/np-social-share-counter.php 92% from 13 tests

This is the main PHP file of "Free Social Share Counter Plugin For WordPress - NP Social Share Counter" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 247 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected9,956 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
CSS6542616,993
PHP292544932,202
SVG100640
JavaScript22363121

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity32.12
▷ Minimum class complexity1.00
▷ Maximum class complexity153.00
Average method complexity6.19
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods48
▷ Static methods714.58%
▷ Public methods4389.58%
▷ Protected methods00.00%
▷ Private methods510.42%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants48
▷ Global constants48100.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
18 PNG files occupy 0.35MB with 0.21MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/social_share_preview/share_template5.png18.41KB6.43KB▼ 65.09%
admin/images/counter_preview/counter_template3.png17.74KB7.31KB▼ 58.77%
admin/images/counter_position/left_position.png21.99KB8.53KB▼ 61.23%
admin/images/counter_position/inside_button_position.png30.09KB12.19KB▼ 59.50%
admin/images/counter_preview/counter_template2.png21.98KB9.05KB▼ 58.84%