This commit is contained in:
Thomas Günther 2023-12-30 14:34:31 +01:00
parent b5112ab12e
commit ba736ef661
63 changed files with 65 additions and 59 deletions

View File

@ -33,7 +33,7 @@ if ( ! function_exists( 'trigger_pfadfinden_plugin_error' ) ) {
// Check for suitable environment
if ( defined( 'PHP_VERSION_ID' ) && PHP_VERSION_ID >= 50400 ) {
// Register autoloader if updater plugin missing
if ( ! class_exists( 'Shy\WordPress\Theme' ) ) {
if ( ! class_exists( 'plugins\buena\use\shy-wordpress\src\Shy\WordPress\Theme' ) ) {
if ( ! include_once __DIR__ . '/use/shy-wordpress/src/autoloader.php' ) {
trigger_pfadfinden_plugin_error(
__( 'Das Theme ist unvollständig und konnte nicht geladen werden. Neuinstallation müsste helfen.', 'buena-theme' ),
@ -53,13 +53,13 @@ if ( defined( 'PHP_VERSION_ID' ) && PHP_VERSION_ID >= 50400 ) {
}
/**
* @return \Pfadfinden\WordPress\BuenaTheme
* @return \plugins\buena\src\Pfadfinden\WordPress\BuenaTheme
*/
function buena_get_theme()
{
static $theme = null;
if (!$theme) {
$theme = new ReflectionClass( 'Pfadfinden\WordPress\BuenaTheme' );
$theme = new ReflectionClass( 'plugins\buena\src\Pfadfinden\WordPress\BuenaTheme' );
$theme = $theme->newInstance();
}

View File

@ -1,10 +1,10 @@
<?php
namespace Shy\WordPress;
namespace plugins\buena\use\shy-wordpress\src\Shy\WordPress;
/**
use plugins\buena\use\shy/**
* A composite option with a fixed number of suboptions and their default values.
*/
abstract class CompositeOption implements \ArrayAccess, \Countable, \IteratorAggregate

View File

@ -1,6 +1,6 @@
<?php
namespace Shy\WordPress;
namespace plugins\buena\use\shy-wordpress\src\Shy\WordPress;

View File

@ -1,10 +1,10 @@
<?php
namespace Shy\WordPress;
namespace plugins\buena\use\shy-wordpress\src\Shy\WordPress;
/**
use plugins\buena\use\shy/**
* Marker class for WordPress plugins.
*/
abstract class Plugin

View File

@ -1,10 +1,10 @@
<?php
namespace Shy\WordPress;
namespace plugins\buena\use\shy-wordpress\src\Shy\WordPress;
/**
use plugins\buena\use\shyuse plugins\buena\use\shy/**
* Abstracts common functionality and escaping for the Settings API.
*
* TODO: Check slug and field names for illegal characters.

View File

@ -1,10 +1,10 @@
<?php
namespace Shy\WordPress;
namespace plugins\buena\use\shy-wordpress\src\Shy\WordPress;
abstract class Theme extends Plugin
use plugins\buena\use\shyabstract class Theme extends Plugin
{
public function __construct()
{

View File

@ -1,8 +1,8 @@
<?php
namespace Shy\WordPress\Tests;
namespace plugins\buena\use\shy-wordpress\tests\Shy\WordPress\Tests;
use Shy\WordPress\HookableTrait;
use wordpress\src\Shy\WordPress\HookableTrait;

View File

@ -1,8 +1,8 @@
<?php
namespace Shy\WordPress\Tests;
namespace plugins\buena\use\shy-wordpress\tests\Shy\WordPress\Tests;
use Shy\WordPress\SettingsPage;
use wordpress\src\Shy\WordPress\SettingsPage;
use PHPUnit_Framework_MockObject_MockObject as MockObject;
use PHPUnit_Framework_MockObject_Builder_InvocationMocker as BuilderInvocationMocker;
@ -15,13 +15,14 @@ class SettingsPageTest extends \WP_UnitTestCase
*
* @param string|null $slug
* @param string $capability
* @return SettingsPage|MockObject {
*
* @return wordpress\src\Shy\WordPress\SettingsPage|MockObject {
* @method BuilderInvocationMocker method(string)
* }
*/
protected function mockSettingsPage( $slug = null, $capability = 'manage_options' )
{
$builder = $this->getMockBuilder( 'Shy\WordPress\SettingsPage' )
$builder = $this->getMockBuilder( 'plugins\buena\use\shy-wordpress\src\Shy\WordPress\SettingsPage' )
->enableProxyingToOriginalMethods();
if ( null === $slug ) {
@ -37,10 +38,10 @@ class SettingsPageTest extends \WP_UnitTestCase
/**
* Test reading defaults from the settings page.
*
* @covers SettingsPage::__construct()
* @covers SettingsPage::getDefaults()
* @covers SettingsPage::offsetExists()
* @covers SettingsPage::offsetGet()
* @covers wordpress\src\Shy\WordPress\SettingsPage::__construct()
* @covers wordpress\src\Shy\WordPress\SettingsPage::getDefaults()
* @covers wordpress\src\Shy\WordPress\SettingsPage::offsetExists()
* @covers wordpress\src\Shy\WordPress\SettingsPage::offsetGet()
* @expectedException OutOfBoundsException
*/
public function testReading()
@ -63,7 +64,7 @@ class SettingsPageTest extends \WP_UnitTestCase
/**
* Test writing to the settings page.
*
* @covers SettingsPage::offsetSet()
* @covers wordpress\src\Shy\WordPress\SettingsPage::offsetSet()
* @expectedException OutOfBoundsException
*/
public function testWriting()
@ -100,10 +101,10 @@ class SettingsPageTest extends \WP_UnitTestCase
/**
* Test whether the settings page can be showed.
*
* @covers SettingsPage::__construct()
* @covers SettingsPage::getParentSlug()
* @covers SettingsPage::getPageTitle()
* @covers SettingsPage::getMenuTitle()
* @covers wordpress\src\Shy\WordPress\SettingsPage::__construct()
* @covers wordpress\src\Shy\WordPress\SettingsPage::getParentSlug()
* @covers wordpress\src\Shy\WordPress\SettingsPage::getPageTitle()
* @covers wordpress\src\Shy\WordPress\SettingsPage::getMenuTitle()
*/
public function testRegisterPage()
{
@ -124,7 +125,7 @@ class SettingsPageTest extends \WP_UnitTestCase
/**
* @covers SettingsPage::sanitizeOptions()
* @covers wordpress\src\Shy\WordPress\SettingsPage::sanitizeOptions()
*/
public function testSanitize()
{

View File

Before

Width:  |  Height:  |  Size: 135 KiB

After

Width:  |  Height:  |  Size: 135 KiB

View File

Before

Width:  |  Height:  |  Size: 783 B

After

Width:  |  Height:  |  Size: 783 B

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 332 KiB

After

Width:  |  Height:  |  Size: 332 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

Before

Width:  |  Height:  |  Size: 148 B

After

Width:  |  Height:  |  Size: 148 B

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 379 B

After

Width:  |  Height:  |  Size: 379 B

View File

Before

Width:  |  Height:  |  Size: 599 B

After

Width:  |  Height:  |  Size: 599 B

View File

Before

Width:  |  Height:  |  Size: 639 B

After

Width:  |  Height:  |  Size: 639 B

View File

Before

Width:  |  Height:  |  Size: 561 B

After

Width:  |  Height:  |  Size: 561 B

View File

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 78 KiB

View File

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

View File

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 57 KiB

View File

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 64 KiB

View File

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

View File

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 119 KiB

View File

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

View File

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 63 KiB

View File

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 907 B

After

Width:  |  Height:  |  Size: 907 B

View File

Before

Width:  |  Height:  |  Size: 545 B

After

Width:  |  Height:  |  Size: 545 B

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 336 KiB

After

Width:  |  Height:  |  Size: 336 KiB

View File

@ -1,12 +1,13 @@
<?php
namespace Pfadfinden\WordPress;
namespace plugins\buena\src\Pfadfinden\WordPress;
use Shy\WordPress\CompositeOption;
use Pfadfinden\WordPress\wordpress;
use wordpress\src\Shy\WordPress\CompositeOption;
class BuenaSettings extends CompositeOption
class BuenaSettings extends wordpress\src\Shy\WordPress\CompositeOption
{
public function __construct()
{

View File

@ -1,6 +1,6 @@
<?php
namespace Pfadfinden\WordPress;
namespace plugins\buena\src\Pfadfinden\WordPress;
use Shy\WordPress\Administration\SettingsPage;
use Shy\WordPress\Administration\CheckboxField;

View File

@ -1,12 +1,15 @@
<?php
namespace Pfadfinden\WordPress;
namespace plugins\buena\src\Pfadfinden\WordPress;
use Shy\WordPress\Theme;
use Pfadfinden\WordPress\wordpress;
use plugins\buena\src\Pfadfinden\WordPress\BuenaSettings;
use plugins\buena\src\Pfadfinden\WordPress\BuenaSettingsPage;
use wordpress\src\Shy\WordPress\Theme;
class BuenaTheme extends Theme
class BuenaTheme extends wordpress\src\Shy\WordPress\Theme
{
/**
* @var BuenaSettings
@ -234,7 +237,7 @@ class BuenaTheme extends Theme
*/
public function initAdministration()
{
if ( isset( $_GET['exp'] ) && class_exists( 'Pfadfinden\WordPress\BuenaSettingsPage' ) ) {
if ( isset( $_GET['exp'] ) && class_exists( 'plugins\buena\src\Pfadfinden\WordPress\BuenaSettingsPage' ) ) {
new BuenaSettingsPage( $this->settings );
}

View File

@ -63,7 +63,7 @@ if ( ! function_exists( 'trigger_pfadfinden_plugin_error' ) ) {
// Check for suitable environment
if ( defined( 'PHP_VERSION_ID' ) && PHP_VERSION_ID >= 50400 ) {
// If were the first user of the library, use the bundled one
if ( ! class_exists( 'Shy\WordPress\Plugin' ) ) {
if ( ! class_exists( 'plugins\buena\use\shy-wordpress\src\Shy\WordPress\Plugin' ) ) {
pfadfinden_theme_updater_load_textdomain();
if ( ! include_once __DIR__ . '/use/shy-wordpress/src/autoloader.php' ) {
trigger_pfadfinden_plugin_error(

View File

@ -2,7 +2,7 @@
namespace Pfadfinden\WordPress;
use Shy\WordPress\Plugin;
use wordpress\src\Shy\WordPress\Plugin;
@ -13,7 +13,7 @@ use Shy\WordPress\Plugin;
*
* @author Philipp Cordes <philipp.cordes@pfadfinden.de>
*/
class ThemeUpdaterPlugin extends Plugin
class ThemeUpdaterPlugin extends wordpress\src\Shy\WordPress\Plugin
{
const ACTION_QUERY_THEMES = 'query_themes';
const ACTION_FEATURE_LIST = 'feature_list';

View File

@ -2,7 +2,7 @@
namespace Pfadfinden\WordPress;
use Shy\WordPress\SettingsPage;
use wordpress\src\Shy\WordPress\SettingsPage;
@ -11,7 +11,7 @@ use Shy\WordPress\SettingsPage;
*
* @author Philipp Cordes <philipp.cordes@pfadfinden.de>
*/
class ThemeUpdaterSettings extends SettingsPage
class ThemeUpdaterSettings extends wordpress\src\Shy\WordPress\SettingsPage
{
/**
* Full path of plugin main file.

View File

@ -4,7 +4,7 @@ namespace Shy\WordPress;
/**
use plugins\buena\use\shy/**
* A composite option with a fixed number of suboptions and their default values.
*/
abstract class CompositeOption implements \ArrayAccess, \Countable, \IteratorAggregate

View File

@ -4,7 +4,7 @@ namespace Shy\WordPress;
/**
use plugins\buena\use\shy/**
* Marker class for WordPress plugins.
*/
abstract class Plugin

View File

@ -4,7 +4,7 @@ namespace Shy\WordPress;
/**
use plugins\buena\use\shyuse plugins\buena\use\shy/**
* Abstracts common functionality and escaping for the Settings API.
*
* TODO: Check slug and field names for illegal characters.

View File

@ -4,7 +4,7 @@ namespace Shy\WordPress;
abstract class Theme extends Plugin
use plugins\buena\use\shyabstract class Theme extends Plugin
{
public function __construct()
{

View File

@ -2,7 +2,7 @@
namespace Shy\WordPress\Tests;
use Shy\WordPress\HookableTrait;
use wordpress\src\Shy\WordPress\HookableTrait;

View File

@ -2,7 +2,7 @@
namespace Shy\WordPress\Tests;
use Shy\WordPress\SettingsPage;
use wordpress\src\Shy\WordPress\SettingsPage;
use PHPUnit_Framework_MockObject_MockObject as MockObject;
use PHPUnit_Framework_MockObject_Builder_InvocationMocker as BuilderInvocationMocker;
@ -15,13 +15,14 @@ class SettingsPageTest extends \WP_UnitTestCase
*
* @param string|null $slug
* @param string $capability
* @return SettingsPage|MockObject {
*
* @return wordpress\src\Shy\WordPress\SettingsPage|MockObject {
* @method BuilderInvocationMocker method(string)
* }
*/
protected function mockSettingsPage( $slug = null, $capability = 'manage_options' )
{
$builder = $this->getMockBuilder( 'Shy\WordPress\SettingsPage' )
$builder = $this->getMockBuilder( 'plugins\buena\use\shy-wordpress\src\Shy\WordPress\SettingsPage' )
->enableProxyingToOriginalMethods();
if ( null === $slug ) {
@ -37,10 +38,10 @@ class SettingsPageTest extends \WP_UnitTestCase
/**
* Test reading defaults from the settings page.
*
* @covers SettingsPage::__construct()
* @covers SettingsPage::getDefaults()
* @covers SettingsPage::offsetExists()
* @covers SettingsPage::offsetGet()
* @covers wordpress\src\Shy\WordPress\SettingsPage::__construct()
* @covers wordpress\src\Shy\WordPress\SettingsPage::getDefaults()
* @covers wordpress\src\Shy\WordPress\SettingsPage::offsetExists()
* @covers wordpress\src\Shy\WordPress\SettingsPage::offsetGet()
* @expectedException OutOfBoundsException
*/
public function testReading()
@ -63,7 +64,7 @@ class SettingsPageTest extends \WP_UnitTestCase
/**
* Test writing to the settings page.
*
* @covers SettingsPage::offsetSet()
* @covers wordpress\src\Shy\WordPress\SettingsPage::offsetSet()
* @expectedException OutOfBoundsException
*/
public function testWriting()
@ -100,10 +101,10 @@ class SettingsPageTest extends \WP_UnitTestCase
/**
* Test whether the settings page can be showed.
*
* @covers SettingsPage::__construct()
* @covers SettingsPage::getParentSlug()
* @covers SettingsPage::getPageTitle()
* @covers SettingsPage::getMenuTitle()
* @covers wordpress\src\Shy\WordPress\SettingsPage::__construct()
* @covers wordpress\src\Shy\WordPress\SettingsPage::getParentSlug()
* @covers wordpress\src\Shy\WordPress\SettingsPage::getPageTitle()
* @covers wordpress\src\Shy\WordPress\SettingsPage::getMenuTitle()
*/
public function testRegisterPage()
{
@ -124,7 +125,7 @@ class SettingsPageTest extends \WP_UnitTestCase
/**
* @covers SettingsPage::sanitizeOptions()
* @covers wordpress\src\Shy\WordPress\SettingsPage::sanitizeOptions()
*/
public function testSanitize()
{