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

Code Review | NextScripts: Social Networks Auto-Poster

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

About plugin

  • Plugin page: social-networks-a...
  • Plugin version: 4.4.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Mar 2, 2012
  • Latest release: Dec 2, 2023
  • Number of updates: 386
  • Update frequency: every 11.1 days
  • Top authors: NextScripts (100%)

Code review

54 tests

User reviews

615 reviews

Install metrics

60,000+ active /7,309,006 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲6.30MB] [CPU: ▲37.13ms] 50% from 4 tests

A check of server-side resources used by NextScripts: Social Networks Auto-Poster
It is recommended to improve the following
  • CPU: Try to keep total CPU usage under 500.00ms (currently 1,152.06ms on /wp-admin/admin.php?page=nxs-addons)
  • Extra RAM: Extra memory usage should kept under 5MB (currently 6.30MB on /wp-admin/admin.php?page=nxssnap-settings)
PageMemory (MB)CPU Time (ms)
Home /9.77 ▲6.3178.36 ▲38.26
Dashboard /wp-admin9.62 ▲6.2886.56 ▲22.30
Posts /wp-admin/edit.php9.67 ▲6.3193.95 ▲42.04
Add New Post /wp-admin/post-new.php12.23 ▲6.34137.14 ▲49.27
Media Library /wp-admin/upload.php9.55 ▲6.3280.88 ▲45.90
Addons /wp-admin/admin.php?page=nxs-addons9.541,152.06
Reposter /wp-admin/admin.php?page=nxssnap-reposter9.5780.58
Help/Support /wp-admin/admin.php?page=nxs-help9.5374.36
Settings /wp-admin/admin.php?page=nxssnap-settings9.5477.08

Server storage [IO: ▲5.68MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 243 new files
Database: 2 new tables, 8 new options
New tables
wp_nxs_query
wp_nxs_log
New WordPress options
theysaidso_admin_options
db_upgraded
nxs_log_db_table_version
can_compress_scripts
widget_recent-posts
nxs_query_db_table_version
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for NextScripts: Social Networks Auto-Poster
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,941 ▲16913.51 ▼0.817.32 ▲5.4034.96 ▼9.10
Dashboard /wp-admin2,251 ▲715.65 ▼0.0191.10 ▼10.8981.52 ▲35.74
Posts /wp-admin/edit.php2,169 ▲692.04 ▲0.0637.78 ▲1.5433.89 ▼2.18
Add New Post /wp-admin/post-new.php1,796 ▲27021.34 ▼1.66599.99 ▼58.3146.11 ▼14.31
Media Library /wp-admin/upload.php1,459 ▲594.23 ▲0.0497.27 ▲1.8180.45 ▲39.21
Addons /wp-admin/admin.php?page=nxs-addons1,4872.6048.6894.75
Reposter /wp-admin/admin.php?page=nxssnap-reposter2,2343.1359.5794.11
Help/Support /wp-admin/admin.php?page=nxs-help1,5792.4849.1674.26
Settings /wp-admin/admin.php?page=nxssnap-settings2,8412.9359.79112.42

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_nxs_log
    • wp_nxs_query
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • nxs_query_db_table_version
    • widget_theysaidso_widget
    • can_compress_scripts
    • nxs_log_db_table_version
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 38× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > 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: Class 'nxs_snapClassNT' not found in wp-content/plugins/social-networks-auto-poster-facebook-twitter-g/inc-cl/tr.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: Class 'nxs_snapClassNT' not found in wp-content/plugins/social-networks-auto-poster-facebook-twitter-g/inc-cl/vb.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/st.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/xi.php:5
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/social-networks-auto-poster-facebook-twitter-g/inc/nxs_class_snap.php on line 1345
    • > PHP Fatal error
      Uncaught Error: Class 'nxs_snapClassNT' not found in wp-content/plugins/social-networks-auto-poster-facebook-twitter-g/inc-cl/pn.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/ig.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-cl/wp.api.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: There are too many tags (59 tag instead of maximum 10)
The official readme.txt might help

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

"NextScripts: Social Networks Auto-Poster" version 4.4.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • 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")
  • Description: The description should be shorter than 140 characters (currently 144 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin17,979 lines of code in 99 files:
LanguageFilesBlank linesComment linesLines of code
PHP802,1991,80612,904
PO File37921,1172,242
JavaScript74163411,620
CSS9182671,213

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 211)
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity53.41
▷ Minimum class complexity1.00
▷ Maximum class complexity662.00
Average method complexity7.82
▷ Minimum method complexity1.00
▷ Maximum method complexity211.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes107
▷ Abstract classes54.67%
▷ Concrete classes10295.33%
▷ Final classes00.00%
Methods834
▷ Static methods647.67%
▷ Public methods80095.92%
▷ Protected methods20.24%
▷ Private methods323.84%
Functions211
▷ Named functions211100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants777.78%
▷ Class constants222.22%
▷ Public constants2100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
135 PNG files occupy 3.16MB with 0.97MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/qIcon.png0.57KB0.43KB▼ 24.91%
img/fbPostTypesDiff6.png88.71KB87.18KB▼ 1.73%
img/tpz-bg.png0.98KB0.11KB▼ 88.73%
img/ig16x.png0.89KB1.15KB0.00%
js-css/blueX.png1.04KB0.65KB▼ 37.72%