10% wp-ajax-social

Code Review | Wordpress Ajax Social

WordPress plugin Wordpress Ajax Social scored 10% from 54 tests.

About plugin

  • Plugin page: wp-ajax-social
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.4
  • WordPress version: 6.3.1
  • First release: Mar 11, 2013
  • Latest release: Mar 19, 2013
  • Number of updates: 7
  • Update frequency: every 1.3 days
  • Top authors: phpaddicted (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,647 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/wp-ajax-social/wp-ajax-social.php+71
    Function create_function() is deprecated

Server metrics [RAM: ▼1.96MB] [CPU: ▼51.24ms] Passed 4 tests

A check of server-side resources used by Wordpress Ajax Social
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.445.71 ▼39.39
Dashboard /wp-admin2.05 ▼1.266.23 ▼39.35
Posts /wp-admin/edit.php2.05 ▼1.316.09 ▼42.01
Add New Post /wp-admin/post-new.php2.05 ▼3.845.57 ▼84.20
Media Library /wp-admin/upload.php2.05 ▼1.185.21 ▼28.37
WP Ajax Social /wp-admin/options-general.php?page=wp-ajax-social2.056.05

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 37 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Wordpress Ajax Social
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,901 ▲13013.59 ▼0.707.67 ▲5.5436.06 ▼8.98
Dashboard /wp-admin2,229 ▲414.94 ▲0.08103.40 ▼2.7038.87 ▼3.88
Posts /wp-admin/edit.php2,109 ▲202.21 ▲0.1639.44 ▼0.9434.54 ▼2.43
Add New Post /wp-admin/post-new.php1,541 ▼123.24 ▲5.04626.01 ▲17.9360.35 ▲1.11
Media Library /wp-admin/upload.php1,402 ▲144.24 ▲0.0997.66 ▼8.9042.33 ▼0.66
WP Ajax Social /wp-admin/options-general.php?page=wp-ajax-social1,3342.0039.4267.11

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/wp-ajax-social/wp-ajax-social.php+71
    Function create_function() is deprecated
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=wp-ajax-social
    • > Deprecated in wp-content/plugins/wp-ajax-social/wp-ajax-social.php+71
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=wp-ajax-social
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery-form handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=wp-ajax-social
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the my-style handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=wp-ajax-social
    • > Notice in wp-content/plugins/wp-ajax-social/inc/admin_core.php+408
    Undefined index: wp_ajax_social_submit
  • 17 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-ajax-social
    • > Notice in wp-content/plugins/wp-ajax-social/inc/admin_core.php+619
    Trying to access array offset on value of type bool

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 items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-ajax-social/wp-ajax-social.php

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)
There are user-side issues you should fix
    • > GET request to /wp-admin/options-general.php?page=wp-ajax-social
    • > Network (severe)
    wp-ajax-social/images/facebook.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=wp-ajax-social
    • > Network (severe)
    wp-ajax-social/images/google_plus.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=wp-ajax-social
    • > Network (severe)
    wp-ajax-social/images/twitter.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=wp-ajax-social
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,thickbox,underscore,shortcode,media-upload&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).live is not a function" "TypeError: jQuery(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/wp-ajax-social/js/my-script.js?ver=6.3.1:4:36)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,thickbox,underscore,shortcode,media-upload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,thickbox,underscore,shortcode,media-upload&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=wp-ajax-social
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,thickbox,underscore,shortcode,media-upload&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).live is not a function" "TypeError: jQuery(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/options-general.php?page=wp-ajax-social:105:69)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,thickbox,underscore,shortcode,media-upload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,thickbox,underscore,shortcode,media-upload&ver=6.3.1:2:27292)" undefined
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-ajax-social
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,thickbox,underscore,shortcode,media-upload&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).live is not a function

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: social, facebook, twitter, social icons, pinterest

wp-ajax-social/wp-ajax-social.php 92% from 13 tests

The primary PHP file in "Wordpress Ajax Social" version 1.1 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 687 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin1,196 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP4589551,089
CSS12181
JavaScript191926

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.47
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%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
25 compressed PNG files occupy 0.10MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/hs.png2.62KB7.54KB0.00%
images/gp_medium_bubble.png1.14KB0.88KB▼ 22.67%
images/hv.png2.80KB7.32KB0.00%
images/gp_small_none.png0.68KB0.67KB▼ 0.87%
images/gp_medium_inline.png4.96KB2.60KB▼ 47.68%