93% activity-link-preview-for-buddypress

Code Review | Activity Link Preview For BuddyPress

WordPress plugin Activity Link Preview For BuddyPress scored 93% from 54 tests.

About plugin

  • Plugin page: activity-link-pre...
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.8.1
  • WordPress version: 5.9.2
  • First release: Mar 31, 2021
  • Latest release: Oct 25, 2021
  • Number of updates: 6
  • Update frequency: every 35.3 days
  • Top authors: vapvarun (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active / 1,696 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.02MB] [CPU: ▼299.72ms] Passed 4 tests

An overview of server-side resources used by Activity Link Preview For BuddyPress
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0153.74 ▲2.81
Dashboard /wp-admin3.41 ▲0.0034.18 ▼0.58
Posts /wp-admin/edit.php3.64 ▲0.0037.29 ▼0.07
Add New Post /wp-admin/post-new.php6.88 ▼0.0994.33 ▼1,192.13
Media Library /wp-admin/upload.php3.29 ▲0.0024.08 ▼6.11

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 5 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Activity Link Preview For BuddyPress
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,764 ▲4215.94 ▼0.115.83 ▲0.232.26 ▲0.05
Dashboard /wp-admin2,889 ▲356.10 ▼0.13116.43 ▼18.38153.27 ▼6.08
Posts /wp-admin/edit.php2,694 ▲33.24 ▲0.0163.16 ▼0.48140.77 ▼5.18
Add New Post /wp-admin/post-new.php1,668 ▲718.23 ▲2.14409.55 ▲4.87152.26 ▼6.39
Media Library /wp-admin/upload.php1,698 ▲65.53 ▲0.02141.15 ▼0.21181.59 ▼1.36

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

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 take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/activity-link-preview-for-buddypress/bp-activity-link-preview.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Screenshots: Add an image for screenshot #1 (screenshot-1)
You can look at the official readme.txt

activity-link-preview-for-buddypress/bp-activity-link-preview.php 77% from 13 tests

The main file in "Activity Link Preview For BuddyPress" v. 1.2.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("activity-link-preview-for-buddypress.php" instead of "bp-activity-link-preview.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin540 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1542219
PHP15269187
CSS12811134

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.52
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%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 compressed PNG file occupies 0.10MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png102.03KB101.21KB▼ 0.81%