68% cgsociety-latest-posts

Code Review | cgs-latest-posts

WordPress plugin cgs-latest-posts scored 68% from 54 tests.

About plugin

  • Plugin page: cgsociety-latest-...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.1
  • WordPress version: 6.3.1
  • First release: Dec 2, 2014
  • Latest release: Dec 21, 2014
  • Number of updates: 10
  • Update frequency: every 2.0 days
  • Top authors: kartikg3 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 721 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

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

An overview of server-side resources used by cgs-latest-posts
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0342.58 ▼0.90
Dashboard /wp-admin3.33 ▲0.0245.19 ▼11.70
Posts /wp-admin/edit.php3.44 ▲0.0843.83 ▼4.15
Add New Post /wp-admin/post-new.php5.91 ▲0.0284.33 ▼12.91
Media Library /wp-admin/upload.php3.25 ▲0.0236.49 ▲2.59
CGS Latest Posts Options /wp-admin/options-general.php?page=cgsociety-latest-posts/cgsociety-latest-posts.php3.1931.85

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_khcgsocietylatestposts
cgs_cache_timeout
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for cgs-latest-posts
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲7513.37 ▼0.913.06 ▲1.0744.04 ▼4.12
Dashboard /wp-admin2,207 ▲195.85 ▲0.0794.12 ▼6.6639.54 ▼5.67
Posts /wp-admin/edit.php2,093 ▲252.03 ▲0.0134.18 ▼0.5632.19 ▼1.28
Add New Post /wp-admin/post-new.php1,540 ▲723.40 ▲0.22651.12 ▼11.8055.34 ▼6.95
Media Library /wp-admin/upload.php1,392 ▲74.25 ▲0.08106.32 ▲3.8847.23 ▲3.28
CGS Latest Posts Options /wp-admin/options-general.php?page=cgsociety-latest-posts/cgsociety-latest-posts.php8242.0228.2022.73

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/cgsociety-latest-posts/uninstall.php+14
    Trying to access array offset on value of type int
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_khcgsocietylatestposts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=cgsociety-latest-posts/cgsociety-latest-posts.php
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=cgsociety-latest-posts/cgsociety-latest-posts.php
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 50% 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× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/cgsociety-latest-posts/cgsociety-latest-posts.php:29

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 Passed 29 tests

readme.txt Passed 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
6 plugin tags: cgtalk, latest, cgsociety, posts, widget...

cgsociety-latest-posts/cgsociety-latest-posts.php Passed 13 tests

"cgs-latest-posts" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
43 characters long description:
Widget to list your latest CGSociety posts.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected7,088 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
CSS261,3385,374
PHP33062871,712
JavaScript1052

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity121.67
▷ Minimum class complexity36.00
▷ Maximum class complexity198.00
Average method complexity4.93
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods92
▷ Static methods11.09%
▷ Public methods7682.61%
▷ Protected methods1617.39%
▷ Private methods00.00%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants21
▷ Global constants21100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.02MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/cgs_old_logo.png13.54KB4.00KB▼ 70.45%
images/cgs_old_logo_sm.png9.14KB2.35KB▼ 74.32%