10% odlinks

Code Review | Open Links Directory

WordPress plugin Open Links Directory scored10%from 54 tests.

About plugin

  • Plugin page: odlinks
  • Plugin version: 1.5.0-a...
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.0
  • WordPress version: 6.3.1
  • First release: Oct 9, 2008
  • Latest release: Dec 17, 2018
  • Number of updates: 311
  • Update frequency: every 12.0 days
  • Top authors: cina (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

40+ active /33,384 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/odlinks/includes/odl_functions.php+79
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▼1.91MB] [CPU: ▼52.45ms] Passed 4 tests

Analyzing server-side resources used by Open Links Directory
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.386.16 ▼36.22
Dashboard /wp-admin2.10 ▼1.207.51 ▼45.94
Posts /wp-admin/edit.php2.11 ▼1.256.31 ▼38.77
Add New Post /wp-admin/post-new.php2.10 ▼3.797.48 ▼88.87
Media Library /wp-admin/upload.php2.11 ▼1.127.66 ▼26.58
Settings /wp-admin/admin.php?page=odlinkssettings2.107.23
ODLinks /wp-admin/admin.php?page=odlinks/admin/odl_admin.php2.187.56
Utilities /wp-admin/admin.php?page=odlinksutilities2.186.58
Categories /wp-admin/admin.php?page=odlinksstructure2.187.31

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 291 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
recovery_mode_email_last_sent
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
odlinksdata
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Open Links Directory
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲8413.34 ▼1.044.66 ▲2.6733.57 ▼9.92
Dashboard /wp-admin2,225 ▲374.94 ▼0.88103.32 ▼13.1373.46 ▲27.07
Posts /wp-admin/edit.php2,123 ▲342.02 ▲0.0135.74 ▼0.9537.14 ▲2.03
Add New Post /wp-admin/post-new.php1,539 ▲623.77 ▲0.50777.24 ▲72.4849.04 ▼3.52
Media Library /wp-admin/upload.php1,413 ▲314.26 ▲0.01109.14 ▲12.9288.16 ▲42.44
Settings /wp-admin/admin.php?page=odlinkssettings8961.147.4239.09
ODLinks /wp-admin/admin.php?page=odlinks/admin/odl_admin.php8792.0223.2332.15
Utilities /wp-admin/admin.php?page=odlinksutilities8082.0626.1025.30
Categories /wp-admin/admin.php?page=odlinksstructure8502.1828.5527.83

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/odlinks/includes/odl_functions.php+79
    Array and string offset access syntax with curly braces is deprecated
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • recovery_mode_email_last_sent
    • widget_recent-comments
    • can_compress_scripts
    • odlinksdata

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 40 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=odlinksstructure
    • > Deprecated in wp-content/plugins/odlinks/odl_main.php+295
    Array and string offset access syntax with curly braces is deprecated
  • 27 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=odlinksstructure
    • > 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.
    • > GET request to /wp-admin/admin.php?page=odlinkssettings
    • > Notice in wp-content/plugins/odlinks/admin/odl_admin_settings.php+63
    Trying to access array offset on value of type bool
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=odlinkssettings
    • > Notice in wp-content/plugins/odlinks/admin/odl_admin_settings.php+332
    Undefined variable: user_field
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=odlinkssettings
    • > Warning in wp-content/plugins/odlinks/admin/odl_admin_settings.php+102
    Use of undefined constant ODL_SUBMITTING_NOTE - assumed 'ODL_SUBMITTING_NOTE' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=odlinkssettings
    • > Notice in wp-content/plugins/odlinks/admin/odl_admin_settings.php+211
    Undefined variable: odl_lang
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=odlinkssettings
    • > Notice in wp-content/plugins/odlinks/admin/odl_admin_settings.php+211
    Trying to access array offset on value of type null
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=odlinkssettings
    • > Warning in wp-content/plugins/odlinks/admin/odl_admin_settings.php+102
    Use of undefined constant ODL_SUBMITTING_TEXT - assumed 'ODL_SUBMITTING_TEXT' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/admin.php?page=odlinkssettings
    • > Notice in wp-content/plugins/odlinks/admin/odl_admin_settings.php+102
    Undefined index: description
    • > GET request to /wp-admin/admin.php?page=odlinkssettings
    • > Deprecated in wp-content/plugins/odlinks/admin/odl_admin_settings.php+151
    The each() function is deprecated. This message will be suppressed on further calls
    • > GET request to /wp-admin/admin.php?page=odlinkssettings
    • > Error in wp-content/plugins/odlinks/admin/odl_admin_settings.php+152
    Uncaught Error: Call to undefined function ereg() in wp-content/plugins/odlinks/admin/odl_admin_settings.php:152
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): process_odlinkssettings()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/admin.php(259): do_action()
    #4 {main}
    thrown
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=odlinksstructure
    • > Notice in wp-content/plugins/odlinks/admin/odl_admin_structure.php+24
    Undefined index: odlinks_admin_action
    • > GET request to /wp-admin/admin.php?page=odlinks/admin/odl_admin.php
    • > Notice in wp-content/plugins/odlinks/admin/odl_admin_functions.php+63
    Undefined index: id
    • > GET request to /wp-admin/admin.php?page=odlinks/admin/odl_admin.php
    • > Notice in wp-content/plugins/odlinks/admin/odl_admin_functions.php+63
    Undefined index: action
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=odlinksutilities
    • > Notice in wp-content/plugins/odlinks/admin/odl_admin_utilities.php+62
    Undefined variable: PHP_SELF
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=odlinksstructure
    • > Notice in wp-content/plugins/odlinks/admin/odl_admin_structure.php+64
    Undefined variable: msg
    • > GET request to /wp-admin/admin.php?page=odlinksstructure
    • > Notice in wp-content/plugins/odlinks/admin/odl_admin_structure.php+18
    Undefined index: c_id
    • > GET request to /wp-admin/admin.php?page=odlinksstructure
    • > Warning in wp-content/plugins/odlinks/admin/odl_admin_structure.php+138
    Use of undefined constant active - assumed 'active' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/admin.php?page=odlinksstructure
    • > Warning in wp-content/plugins/odlinks/admin/odl_admin_structure.php+138
    Use of undefined constant inactive - assumed 'inactive' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/admin.php?page=odlinksstructure
    • > Warning in wp-content/plugins/odlinks/admin/odl_admin_structure.php+138
    Use of undefined constant readonly - assumed 'readonly' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/admin.php?page=odlinksstructure
    • > Notice in wp-content/plugins/odlinks/admin/odl_admin_structure.php+162
    Undefined variable: orderby
    • > GET request to /wp-admin/admin.php?page=odlinksstructure
    • > Notice in wp-content/plugins/odlinks/admin/odl_admin_structure.php+162
    Undefined variable: how

SRP 0% 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 take a closer look at the following
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/odlinks/language/lang_ru.php
    • > /wp-content/plugins/odlinks/includes/odl_rss.php
    • > /wp-content/plugins/odlinks/includes/odl_securimage_show.php
    • > /wp-content/plugins/odlinks/includes/_thumbshots.class.php
  • 91× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Internal_Method_RegisterFilter' not found in wp-content/plugins/odlinks/includes/Smarty/sysplugins/smarty_internal_method_unregisterfilter.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Internal_ParseTree' not found in wp-content/plugins/odlinks/includes/Smarty/sysplugins/smarty_internal_parsetree_dqcontent.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Internal_Compile_Shared_Inheritance' not found in wp-content/plugins/odlinks/includes/Smarty/sysplugins/smarty_internal_compile_block.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Internal_Compile_Ldelim' not found in wp-content/plugins/odlinks/includes/Smarty/sysplugins/smarty_internal_compile_rdelim.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Resource_Recompiled' not found in wp-content/plugins/odlinks/includes/Smarty/sysplugins/smarty_internal_resource_stream.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/odlinks/language/lang_es.php:56
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Internal_CompileBase' not found in wp-content/plugins/odlinks/includes/Smarty/sysplugins/smarty_internal_compile_include.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Internal_Method_CompileAllTemplates' not found in wp-content/plugins/odlinks/includes/Smarty/sysplugins/smarty_internal_method_compileallconfig.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Internal_Compile_Break' not found in wp-content/plugins/odlinks/includes/Smarty/sysplugins/smarty_internal_compile_continue.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Resource' not found in wp-content/plugins/odlinks/includes/Smarty/sysplugins/smarty_resource_uncompiled.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
7 plugin tags: classifieds, website submitting, websites directory, odlinks, open directory...

odlinks/odl_control.php 85% from 13 tests

The main PHP file in "Open Links Directory" ver. 1.5.0-a... adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Version: The version number should be digits and periods (ex. "1.0.3" instead of "1.5.0-a...")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("odlinks.php" instead of "odl_control.php")

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
There were no executable files found in this plugin25,828 lines of code in 247 files:
LanguageFilesBlank linesComment linesLines of code
PHP2302,09412,39424,330
JavaScript4169274803
Smarty103810506
CSS2512112
XML12877

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity16.40
▷ Minimum class complexity1.00
▷ Maximum class complexity203.00
Average method complexity3.95
▷ Minimum method complexity1.00
▷ Maximum method complexity91.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes179
▷ Abstract classes137.26%
▷ Concrete classes16692.74%
▷ Final classes00.00%
Methods954
▷ Static methods303.14%
▷ Public methods90995.28%
▷ Protected methods242.52%
▷ Private methods212.20%
Functions126
▷ Named functions126100.00%
▷ Anonymous functions00.00%
Constants173
▷ Global constants2011.56%
▷ Class constants15388.44%
▷ Public constants153100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
11 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/question.png0.27KB0.14KB▼ 48.73%
images/rss.png0.67KB0.90KB0.00%
images/edit.png3.49KB0.90KB▼ 74.11%
images/asc.png0.21KB0.12KB▼ 41.31%
images/back.png0.72KB0.72KB▼ 0.67%