68% eg-attachments

Code Review | EG-Attachments

WordPress plugin EG-Attachments scored68%from 54 tests.

About plugin

  • Plugin page: eg-attachments
  • Plugin version: 2.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.0-4.2.0
  • WordPress version: 6.3.1
  • First release: Feb 1, 2009
  • Latest release: Apr 26, 2015
  • Number of updates: 88
  • Update frequency: every 25.9 days
  • Top authors: EmmanuelG (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

1,000+ active /60,274 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
Installer ran successfully

Server metrics [RAM: ▲0.40MB] [CPU: ▼3.99ms] Passed 4 tests

Server-side resources used by EG-Attachments
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.3046.79 ▲4.65
Dashboard /wp-admin3.80 ▲0.4552.81 ▼6.85
Posts /wp-admin/edit.php3.85 ▲0.4849.12 ▼1.60
Add New Post /wp-admin/post-new.php6.31 ▲0.4286.64 ▼12.14
Media Library /wp-admin/upload.php3.66 ▲0.4239.97 ▲6.34
EGA templates /wp-admin/tools.php?page=ega_templates3.6034.99
EG-Attachments /wp-admin/options-general.php?page=ega_options3.8736.87

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 196 new files
Database: 1 new table, 7 new options
New tables
wp_eg_attachments_clicks
New WordPress options
theysaidso_admin_options
EG-Attachments-Options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for EG-Attachments
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,910 ▲16413.33 ▼1.091.72 ▲0.0647.81 ▲1.39
Dashboard /wp-admin2,311 ▲1204.98 ▲0.06106.95 ▲7.0137.81 ▼6.39
Posts /wp-admin/edit.php2,102 ▲102.03 ▲0.0333.85 ▼7.3631.87 ▼2.99
Add New Post /wp-admin/post-new.php1,559 ▲2323.23 ▼0.07583.04 ▼69.5253.85 ▼3.24
Media Library /wp-admin/upload.php1,425 ▲374.23 ▼0.0293.17 ▼1.7144.25 ▲1.96
EGA templates /wp-admin/tools.php?page=ega_templates1,2501.8025.7529.48
EG-Attachments /wp-admin/options-general.php?page=ega_options1,6902.2237.3953.11

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_eg_attachments_clicks
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ega_options
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ega_options
    • > 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 10× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/eg-attachments/inc/eg-attachments-tools-form.inc.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/eg-attachments/inc/eg-attachment-keywords-help.inc.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'EG_Plugin_135' not found in wp-content/plugins/eg-attachments/inc/eg-attachments-public.inc.php:12
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/eg-attachments/inc/eg-attachments-tools-form.inc.php on line 4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/eg-attachments/inc/eg-attachments-tools-form.inc.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'EG_Attachments_Common' not found in wp-content/plugins/eg-attachments/inc/eg-attachments-settings.inc.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'EG_Plugin_135' not found in wp-content/plugins/eg-attachments/inc/eg-attachments-admin.inc.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/eg-attachments/lib/eg-widgets.inc.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'EG_Widget_220' not found in wp-content/plugins/eg-attachments/inc/eg-attachments-widgets.inc.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/eg-attachments/lib/eg-widgets.inc.php:31

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

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: shortcode, posts, attachments

eg-attachments/eg-attachments.php Passed 13 tests

The primary PHP file in "EG-Attachments" version 2.1.3 is used by WordPress to initiate all plugin functionality
52 characters long description:
Shortcode displaying lists of attachments for a post

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected12,615 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
PO File133,7936,7358,255
PHP157801,5403,914
CSS24073382
JavaScript47553
Sass11010
SVG1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity62.12
▷ Minimum class complexity5.00
▷ Maximum class complexity157.00
Average method complexity4.70
▷ Minimum method complexity1.00
▷ Maximum method complexity61.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods132
▷ Static methods96.82%
▷ Public methods132100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants19
▷ Global constants19100.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
124 PNG files occupy 0.36MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/flags/file-ext/ppt.png3.34KB2.15KB▼ 35.70%
img/metro/interactive.png4.51KB1.56KB▼ 65.33%
img/flags/file-ext/otp.png3.34KB2.11KB▼ 36.76%
img/flags/file-ext/jpg.png2.06KB1.97KB▼ 4.26%
img/flags/file-ext/sdd.png3.34KB2.11KB▼ 36.76%