67% gra4-social-network

Code Review | GRA4 Social Network

WordPress plugin GRA4 Social Network scored67%from 54 tests.

About plugin

  • Plugin page: gra4-social-network
  • Plugin version: 0.0.5.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.8.1
  • WordPress version: 6.3.1
  • First release: Aug 9, 2012
  • Latest release: Feb 4, 2014
  • Number of updates: 333
  • Update frequency: every 1.6 days
  • Top authors: trof (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

10+ active /19,728 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.78MB] [CPU: ▼34.55ms] Passed 4 tests

This is a short check of server-side resources used by GRA4 Social Network
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1633.96 ▼5.28
Dashboard /wp-admin3.17 ▼0.1824.80 ▼36.30
Posts /wp-admin/edit.php3.17 ▼0.1923.48 ▼24.94
Add New Post /wp-admin/post-new.php3.17 ▼2.7225.36 ▼71.69
Media Library /wp-admin/upload.php3.17 ▼0.0628.51 ▼3.21

Server storage [IO: ▲0.99MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Please fix the following
  • Illegal file modification detected: 1 file (0.24KB) outside of "wp-content/plugins/gra4-social-network/" and "wp-content/uploads/"
    • (new file) wp-content/themes/twentytwentyone/page-gra4.php
Filesystem: 29 new files
Database: no new tables, 14 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
gra4_reset_page
can_compress_scripts
gra4_margin_none
db_upgraded
gra4_version
gra4_delta_width
widget_recent-posts
gra4_dom_node_id
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for GRA4 Social Network
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,854 ▲11913.57 ▼1.181.75 ▼0.2133.62 ▼18.67
Dashboard /wp-admin2,245 ▲605.87 ▼0.0197.69 ▼3.5281.85 ▲38.33
Posts /wp-admin/edit.php2,128 ▲362.03 ▲0.0233.63 ▼9.0133.90 ▼4.98
Add New Post /wp-admin/post-new.php1,701 ▲18722.25 ▲4.78740.63 ▲134.4255.95 ▲5.81
Media Library /wp-admin/upload.php1,421 ▲334.21 ▼0.0595.79 ▲0.6774.52 ▲34.13

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • Zombie WordPress options detected upon uninstall: 14 options
    • gra4_version
    • gra4_dom_tree
    • gra4_reset_page
    • gra4_set_width
    • theysaidso_admin_options
    • gra4_dom_node_id
    • widget_theysaidso_widget
    • widget_recent-comments
    • gra4_margin_none
    • can_compress_scripts
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/gra4-social-network/css/index.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/gra4-social-network/page-gra4.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/gra4-social-network/gra4.php:121

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

readme.txt 88% 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
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (**Activity Streams** - That's how personal activity stream looks like. Global, personal and group activity streams with threaded commenting, direct posting, likes and other social features are supported.), #2 (**Groups** - When a website joins the GRA4 network, new group will be created to simplify user control for the Webmaster.), #3 (**My Groups** - Any user can create new groups with custom access level.), #4 (**Connected to GRA4** - After the plugin is activated and the website Webmaster visits the plugin page, this picture will appear. If you see it - your website successfully joined the GRA4 network.), #5 (**Multiple Languages** - GRA4 Social Network supports multiple languages. Even more will be added soon.), #6 (**Activity Stream** - Another example.)
  • Tags: You are using too many tags: 13 tag instead of maximum 10
You can look at the official readme.txt

gra4-social-network/gra4.php 92% from 13 tests

"GRA4 Social Network" version 0.0.5.7's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("gra4-social-network.php" instead of "gra4.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin3,300 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP106166773,112
JavaScript2407154
CSS19933
HTML1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity143.33
▷ Minimum class complexity103.00
▷ Maximum class complexity197.00
Average method complexity4.56
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods120
▷ Static methods10.83%
▷ Public methods10486.67%
▷ Protected methods1613.33%
▷ Private methods00.00%
Functions39
▷ Named functions39100.00%
▷ Anonymous functions00.00%
Constants29
▷ Global constants29100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
8 PNG files occupy 0.82MB with 0.46MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png24.58KB10.42KB▼ 57.61%
screenshot-2.png208.25KB64.48KB▼ 69.04%
gra4_sm.png1.81KB1.22KB▼ 32.60%
screenshot-3.png119.23KB39.63KB▼ 66.76%
screenshot-5.png10.95KB4.74KB▼ 56.66%