71% accesspress-social-counter

Code Review | AccessPress Social Counter

WordPress plugin AccessPress Social Counter scored 71% from 54 tests.

About plugin

  • Plugin page: accesspress-socia...
  • Plugin version: 1.9.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.8.2
  • WordPress version: 5.9.2
  • First release: Jan 20, 2015
  • Latest release: Nov 12, 2021
  • Number of updates: 111
  • Update frequency: every 22.4 days
  • Top authors: Access Keys (100%)

Code review

54 tests

User reviews

32 reviews

Install metrics

30,000+ active / 1,080,552 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

This is a short check of server-side resources used by AccessPress Social Counter
Please take the time to fix the following items
  • CPU: Try to keep total CPU usage under 500.00ms (currently 577.48ms on /wp-admin/admin.php?page=ap-social-counter)
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.1954.46 ▲0.05
Dashboard /wp-admin3.54 ▲0.1432.53 ▼0.29
Posts /wp-admin/edit.php3.77 ▲0.1334.96 ▼1.44
Add New Post /wp-admin/post-new.php7.01 ▲0.0492.66 ▼1,187.93
Media Library /wp-admin/upload.php3.42 ▲0.1225.91 ▼1.14
Check Premium Version /wp-admin/admin.php?page=apsc-premium3.2218.40
Documentation /wp-admin/admin.php?page=apsc-documentation3.2224.69
AccessPress Social Counter /wp-admin/admin.php?page=ap-social-counter3.69577.48

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 97 new files
Database: no new tables, 2 new options
New WordPress options
widget_apsc_widget
apsc_settings

Browser metrics Passed 4 tests

An overview of browser requirements for AccessPress Social Counter
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,809 ▲5515.77 ▼0.295.88 ▼0.052.18 ▼0.58
Dashboard /wp-admin2,933 ▲726.20 ▲0.01118.38 ▼15.66176.62 ▲13.03
Posts /wp-admin/edit.php2,733 ▲763.11 ▲0.0463.73 ▼0.86138.85 ▼2.36
Add New Post /wp-admin/post-new.php1,787 ▲9722.26 ▲1.65417.38 ▼30.55187.40 ▲27.48
Media Library /wp-admin/upload.php1,738 ▲435.55 ▲0.03126.17 ▼14.56206.26 ▲11.94
Check Premium Version /wp-admin/admin.php?page=apsc-premium4,88317.44619.22256.61
Documentation /wp-admin/admin.php?page=apsc-documentation1,1267.89273.28154.18
AccessPress Social Counter /wp-admin/admin.php?page=ap-social-counter2,80014.85418.57187.06

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
  • Zombie WordPress options were found after uninstall: 2 options
    • apsc_settings
    • widget_apsc_widget

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% 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
  • 21× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/accesspress-social-counter/inc/backend/widget.php
    • > /wp-content/plugins/accesspress-social-counter/inc/frontend/social_network/div/comments.php
    • > /wp-content/plugins/accesspress-social-counter/inc/frontend/social_network/div/soundcloud.php
    • > /wp-content/plugins/accesspress-social-counter/inc/frontend/social_network/div/twitter.php
    • > /wp-content/plugins/accesspress-social-counter/inc/frontend/social_network/extract_count/posts.php
    • > /wp-content/plugins/accesspress-social-counter/inc/frontend/social_network/div/dribbble.php
    • > /wp-content/plugins/accesspress-social-counter/inc/frontend/social_network/div/instagram.php
    • > /wp-content/plugins/accesspress-social-counter/inc/backend/save-settings.php
    • > /wp-content/plugins/accesspress-social-counter/inc/frontend/social_network/extract_count/soundcloud.php
    • > /wp-content/plugins/accesspress-social-counter/inc/frontend/social_network/extract_count/instagram.php
  • 9× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/accesspress-social-counter/inc/backend/boards/display-settings.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/accesspress-social-counter/inc/backend/boards/system-status.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/accesspress-social-counter/inc/backend/boards/about.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/accesspress-social-counter/inc/frontend/api.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/accesspress-social-counter/inc/backend/boards/social-profiles.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/accesspress-social-counter/inc/frontend/font-awesome-icon.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/accesspress-social-counter/inc/backend/boards/cache-settings.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/accesspress-social-counter/inc/backend/boards/how-to-use.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/accesspress-social-counter/inc/backend/boards/save-button.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=apsc-premium
    • > Security (warning) in unknown
    https://accesspressthemes.com/wordpress-plugins/accesspress-social-pro/ - Mixed Content: The page at 'https://accesspressthemes.com/wordpress-plugins/accesspress-social-pro/' was loaded over HTTPS, but requested an insecure element 'http://demo.accesspressthemes.com/wordpress-plugins/accesspress-social-pro/wp-content/uploads/2019/07/accesspress-social-pro-salespage.jpg'. This request was automatically upgraded to HTTPS, For more information see https://blog.chromium.org/2019/10/no-more-mixed-messages-about-https.html
    • > GET request to /wp-admin/admin.php?page=apsc-premium
    • > Security (warning) in unknown
    https://accesspressthemes.com/wordpress-plugins/accesspress-social-pro/ 787 Mixed Content: The page at 'https://accesspressthemes.com/wordpress-plugins/accesspress-social-pro/' was loaded over HTTPS, but requested an insecure element 'http://demo.accesspressthemes.com/wordpress-plugins/accesspress-social-pro/wp-content/uploads/2019/07/accesspress-social-pro-salespage.jpg'. This request was automatically upgraded to HTTPS, For more information see https://blog.chromium.org/2019/10/no-more-mixed-messages-about-https.html
    • > GET request to /wp-admin/admin.php?page=apsc-premium
    • > Javascript (severe) in unknown
    https://accesspressthemes.com/wordpress-plugins/accesspress-social-pro/ - Access to script at 'https://embed.tawk.to/60cc2bbb65b7290ac63693ec/1f8eollms' from origin 'https://accesspressthemes.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=apsc-documentation
    • > Network (severe)
    https://embed.tawk.to/60cc2bbb65b7290ac63693ec/1f8eollms - Failed to load resource: net::ERR_FAILED
    • > GET request to /wp-admin/admin.php?page=apsc-documentation
    • > Javascript (severe) in unknown
    https://accesspressthemes.com/documentation/accesspress-social-counter/ 500 Access to script at 'https://embed.tawk.to/60cc2bbb65b7290ac63693ec/1f8eollms' from origin 'https://accesspressthemes.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Screenshots: These screenshots have no corresponding images in /assets: #3 (Backend Social Profiles Section), #4 (Backend Display Settings Section), #5 (Backend Cache Settings Section)
  • Tags: There are too many tags (11 tag instead of maximum 10)
The official readme.txt might help

accesspress-social-counter/accesspress-social-counter.php 85% from 13 tests

The main file in "AccessPress Social Counter" v. 1.9.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 143 characters long)
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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
Good job! No executable or dangerous file extensions detected27,334 lines of code in 46 files:
LanguageFilesBlank linesComment linesLines of code
SVG601221,660
CSS41,078473,252
PHP311611171,686
PO File2172230423
JavaScript33010313

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity35.50
▷ Minimum class complexity9.00
▷ Maximum class complexity62.00
Average method complexity3.09
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods33
▷ Static methods00.00%
▷ Public methods33100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants14100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
17 PNG files occupy 1.45MB with 0.87MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/plugin.png12.50KB5.31KB▼ 57.50%
images/flicker.png1.45KB0.57KB▼ 60.47%
images/pinterest.png2.17KB1.25KB▼ 42.30%
images/sc-icon.png1.30KB0.31KB▼ 76.19%
images/customize.png24.05KB8.41KB▼ 65.05%