Skip to content

Commit

Permalink
PHP 8.2 reconcile shared libraries #63
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbingwide committed Sep 19, 2023
1 parent 025b6f3 commit a06857b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
6 changes: 3 additions & 3 deletions libs/bobbfunc.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php // (C) Copyright Bobbing Wide 2009-2021
<?php // (C) Copyright Bobbing Wide 2009-2023
if ( !defined( "BOBBFUNC_INCLUDED" ) ) {
define( "BOBBFUNC_INCLUDED", "3.4.2" );
define( "BOBBFUNC_INCLUDED", "3.4.3" );

/**
* HTML output library functions
Expand Down Expand Up @@ -872,7 +872,7 @@ function bw_funcname( $prefix, $key, $value=NULL ) {
* @uses plugin_dir_url() to find the plugin base directory then appends the plugin folder and file name
*/
function oik_url( $file=null, $plugin='oik' ) {
$url = plugin_dir_url( null );
$url = plugin_dir_url( '' );
$url .= "$plugin/$file" ;
return( $url );
}
Expand Down
12 changes: 9 additions & 3 deletions libs/oik-depends.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php // (C) Copyright Bobbing Wide 2012-2022
<?php // (C) Copyright Bobbing Wide 2012-2023
if ( !defined( "OIK_DEPENDS_INCLUDED" ) ) {
define( "OIK_DEPENDS_INCLUDED", "3.2.6" );
define( "OIK_DEPENDS_INCLUDED", "3.2.8" );

/**
* Dependency checking library functions
Expand Down Expand Up @@ -104,6 +104,7 @@ function oik_plugin_inactive( $plugin=null, $dependencies=null, $problem=null )
$text .= sprintf( __( 'Plugin %1$s may not be fully functional.', null ), $plug_name );
$text .= '</b>';
$text .= ' ';
/* translators: %s: plugin dependencies, comma separated */
$text .= sprintf( __( 'Please install and activate the required minimum version of this plugin: %1$s', null ), $dependencies );
$text .= "</p>";
if ( current_filter() == "admin_notices" ) {
Expand Down Expand Up @@ -148,8 +149,10 @@ function oik_plugin_plugin_inactive( $plugin=null, $dependencies=null, $problem=
$dependencies = str_replace( ":", ' ' . __( "version", null ) . ' ', $dependencies );
list( $depends ) = explode(' ', trim( $dependencies ));
$text = "<p><b>";
/* translators: %s: plugin dependencies, comma separated */
$text .= sprintf( __( '%1$s may not be fully functional.', null), $plugin_name );
$text .= "</b> ";
/* translators: %s: plugin dependencies, comma separated */
$text .= sprintf( __( 'Please install and activate the required minimum version of this plugin: %1$s', null ), $dependencies );
$text .= "</p>";

Expand Down Expand Up @@ -189,7 +192,7 @@ function oik_plugin_plugin_inactive( $plugin=null, $dependencies=null, $problem=
*/
function oik_check_version( $depend, $version ) {
$active = true;
$version_func = "${depend}_version";
$version_func = "{$depend}_version";
if ( is_callable( $version_func )) {
$active_version = $version_func();
$active = version_compare( $active_version, $version, "ge" );
Expand Down Expand Up @@ -282,6 +285,7 @@ function oik_install_plugin( $plugin ) {
$link = '<a href="';
$link .= $url;
$link .= '">';
/* translators: %s: plugin name */
$link .= sprintf( __( 'Install %1$s', null ), $plugin );
$link .= "</a>";
return( $link );
Expand Down Expand Up @@ -310,6 +314,7 @@ function oik_activate_plugin( $plugin, $plugin_name) {
$link = '<a href="';
$link .= $url;
$link .= '">';
/* translators: %s: plugin name */
$link .= sprintf( __( 'Activate %1$s', null ), $plugin_name );
$link .= "</a>";
return( $link );
Expand All @@ -328,6 +333,7 @@ function oik_update_plugin( $plugin ) {
$link = '<a href="';
$link .= $url;
$link .= '">';
/* translators: %s: plugin name */
$link .= sprintf( __( 'Upgrade %1$s', null ), $plugin );
$link .= "</a>";
return( $link );
Expand Down

0 comments on commit a06857b

Please sign in to comment.