73% social-networks-auto-poster-facebook-twitter-g

Code Review | NextScripts: Social Networks Auto-Poster

WordPress plugin NextScripts: Social Networks Auto-Poster scored 73% from 54 tests.

About plugin

  • Plugin page: social-networks-a...
  • Plugin version: 4.3.25
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-5.9
  • WordPress version: 5.9.2
  • First release: Mar 2, 2012
  • Latest release: Jan 27, 2022
  • Number of updates: 376
  • Update frequency: every 9.6 days
  • Top authors: NextScripts (100%)

Code review

54 tests

User reviews

584 reviews

Install metrics

90,000+ active / 7,023,500 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

Server-side resources used by NextScripts: Social Networks Auto-Poster
Please fix the following
  • Extra RAM: The extra memory usage must be under 5MB (currently 6.37MB on /wp-admin/admin.php?page=nxs-help)
PageMemory (MB)CPU Time (ms)
Home /9.95 ▲6.44157.58 ▲103.72
Dashboard /wp-admin9.80 ▲6.40105.29 ▲55.67
Posts /wp-admin/edit.php10.02 ▲6.3993.98 ▲46.12
Add New Post /wp-admin/post-new.php13.28 ▲6.31167.52 ▼1,109.75
Media Library /wp-admin/upload.php9.69 ▲6.39115.14 ▲87.04
Settings /wp-admin/admin.php?page=nxssnap-settings9.6888.48
Reposter /wp-admin/admin.php?page=nxssnap-reposter9.7185.44
Help/Support /wp-admin/admin.php?page=nxs-help9.6886.44

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 234 new files
Database: 2 new tables, 2 new options
New tables
wp_nxs_log
wp_nxs_query
New WordPress options
nxs_query_db_table_version
nxs_log_db_table_version

Browser metrics Passed 4 tests

Checking browser requirements for NextScripts: Social Networks Auto-Poster
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,986 ▲23215.89 ▲1.1117.10 ▲8.234.19 ▲1.07
Dashboard /wp-admin2,961 ▲1006.00 ▼0.16176.06 ▲22.83217.79 ▲55.26
Posts /wp-admin/edit.php2,772 ▲813.16 ▼0.0788.26 ▲16.03204.38 ▲43.71
Add New Post /wp-admin/post-new.php2,056 ▲39123.22 ▲2.04657.05 ▲103.71311.94 ▲131.39
Media Library /wp-admin/upload.php1,771 ▲735.55 ▲0.11204.79 ▲43.36310.18 ▲107.59
Settings /wp-admin/admin.php?page=nxssnap-settings3,7703.91128.91361.47
Reposter /wp-admin/admin.php?page=nxssnap-reposter2,7634.26125.84234.96
Help/Support /wp-admin/admin.php?page=nxs-help2,0603.3299.53245.03

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_nxs_log
    • wp_nxs_query
  • This plugin does not fully uninstall, leaving 2 options in the database
    • nxs_query_db_table_version
    • nxs_log_db_table_version

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)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 38× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'nxs_snapClassNT' not found in wp-content/plugins/social-networks-auto-poster-facebook-twitter-g/inc-cl/di.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'nxs_snapClassNT' not found in wp-content/plugins/social-networks-auto-poster-facebook-twitter-g/inc-cl/yt.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'nxs_snapClassNT' not found in wp-content/plugins/social-networks-auto-poster-facebook-twitter-g/inc-cl/lj.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/social-networks-auto-poster-facebook-twitter-g/inc/nxs_functions_wp.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/social-networks-auto-poster-facebook-twitter-g/inc-cl/wp.api.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'nxs_snapClassNT' not found in wp-content/plugins/social-networks-auto-poster-facebook-twitter-g/inc-cl/gp.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'nxs_snapClassNT' not found in wp-content/plugins/social-networks-auto-poster-facebook-twitter-g/inc-cl/ok.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'nxs_snapClassNT' not found in wp-content/plugins/social-networks-auto-poster-facebook-twitter-g/inc-cl/sc.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'nxs_snapClassNT' not found in wp-content/plugins/social-networks-auto-poster-facebook-twitter-g/inc-cl/yo.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'nxs_snapClassNT' not found in wp-content/plugins/social-networks-auto-poster-facebook-twitter-g/inc-cl/mc.php:5

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 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Tags: There are too many tags (61 tag instead of maximum 10)
You can take inspiration from this readme.txt

social-networks-auto-poster-facebook-twitter-g/NextScripts_SNAP.php 85% from 13 tests

This is the main PHP file of "NextScripts: Social Networks Auto-Poster" version 4.3.25, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Description: The description should be shorter than 140 characters (currently 148 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("social-networks-auto-poster-facebook-twitter-g.php" instead of "NextScripts_SNAP.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin18,936 lines of code in 101 files:
LanguageFilesBlank linesComment linesLines of code
PHP842,3842,23013,877
PO File37921,1172,242
JavaScript64163351,619
CSS8178601,198

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 203)
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity53.78
▷ Minimum class complexity1.00
▷ Maximum class complexity657.00
Average method complexity7.81
▷ Minimum method complexity1.00
▷ Maximum method complexity203.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes115
▷ Abstract classes54.35%
▷ Concrete classes11095.65%
▷ Final classes00.00%
Methods904
▷ Static methods647.08%
▷ Public methods85294.25%
▷ Protected methods20.22%
▷ Private methods505.53%
Functions220
▷ Named functions220100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants990.00%
▷ Class constants110.00%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
124 PNG files occupy 0.72MB with 0.25MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/ip-bg.png11.29KB5.63KB▼ 50.09%
img/qIcon.png0.57KB0.43KB▼ 24.91%
img/cbrb.png0.18KB0.12KB▼ 31.72%
img/mc16.png1.73KB0.90KB▼ 47.68%
img/vk-bg.png7.23KB6.08KB▼ 15.97%