Skip to content

Commit 8aa4ebd

Browse files
committed
Rename main namespace
In order to avoid clashes with other plugins, as asked by the WordPress Plugin Review Team.
1 parent 29ddf98 commit 8aa4ebd

File tree

11 files changed

+44
-42
lines changed

11 files changed

+44
-42
lines changed

frameright.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
* along with Image Display Control WordPress Plugin. If not, see
2828
* https://www.gnu.org/licenses/gpl-3.0.en.html
2929
*
30-
* @package Frameright
30+
* @package FramerightImageDisplayControl
3131
*/
3232

33-
namespace Frameright;
33+
namespace FramerightImageDisplayControl;
3434

3535
require_once __DIR__ . '/src/admin/admin-plugin.php';
3636
require_once __DIR__ . '/src/render/render-plugin.php';

readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ about the plugin or submit pull requests.
4747
== Changelog ==
4848

4949
= 0.0.3 (TODO) =
50-
* TODO
50+
* Renamed software components to avoid name clashes with other plugins.
5151

5252
= 0.0.2 (2022-10-31) =
5353
* Improved algorithm for automatically selecting the best hardcrop.

src/admin/admin-plugin.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
/**
33
* Implementation of the plugin part firing on administrative hooks.
44
*
5-
* @package Frameright\Admin
5+
* @package FramerightImageDisplayControl\Admin
66
*/
77

8-
namespace Frameright\Admin;
8+
namespace FramerightImageDisplayControl\Admin;
99

1010
require_once __DIR__ . '/filesystem.php';
1111
require_once __DIR__ . '/xmp.php';
1212

1313
require_once __DIR__ . '/../debug.php';
14-
use Frameright\Debug;
14+
use FramerightImageDisplayControl\Debug;
1515
require_once __DIR__ . '/../global-functions.php';
16-
use Frameright\GlobalFunctions;
16+
use FramerightImageDisplayControl\GlobalFunctions;
1717

1818
/**
1919
* Implementation of the plugin part firing on administrative hooks.

src/admin/filesystem.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
/**
33
* File-related helper functions.
44
*
5-
* @package Frameright\Admin
5+
* @package FramerightImageDisplayControl\Admin
66
*/
77

8-
namespace Frameright\Admin;
8+
namespace FramerightImageDisplayControl\Admin;
99

1010
/**
1111
* Collection of file-related helper functions. This class has conceptually no

src/admin/xmp.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
/**
33
* XMP-related helper functions.
44
*
5-
* @package Frameright\Admin
5+
* @package FramerightImageDisplayControl\Admin
66
*/
77

8-
namespace Frameright\Admin;
8+
namespace FramerightImageDisplayControl\Admin;
99

1010
/**
1111
* Note: the native iptcparse() and exif_read_data() PHP functions are of no

src/debug.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
/**
33
* Debugging utils.
44
*
5-
* @package Frameright\Debug
5+
* @package FramerightImageDisplayControl\Debug
66
*/
77

8-
namespace Frameright\Debug;
8+
namespace FramerightImageDisplayControl\Debug;
99

1010
/**
1111
* Log $text to debug.log if WP_DEBUG is true.

src/global-functions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
/**
33
* Mockable wrapper of all global functions.
44
*
5-
* @package Frameright
5+
* @package FramerightImageDisplayControl
66
*/
77

8-
namespace Frameright;
8+
namespace FramerightImageDisplayControl;
99

1010
/**
1111
* Wrap here any global function (e.g. the ones provided by WordPress) called

src/render/render-plugin.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
/**
33
* Implementation of the plugin part firing on rendering hooks.
44
*
5-
* @package Frameright\Render
5+
* @package FramerightImageDisplayControl\Render
66
*/
77

8-
namespace Frameright\Render;
8+
namespace FramerightImageDisplayControl\Render;
99

1010
require_once __DIR__ . '/../debug.php';
11-
use Frameright\Debug;
11+
use FramerightImageDisplayControl\Debug;
1212
require_once __DIR__ . '/../global-functions.php';
13-
use Frameright\GlobalFunctions;
13+
use FramerightImageDisplayControl\GlobalFunctions;
1414

1515
/**
1616
* Implementation of the plugin part firing on rendering hooks.

tests/AdminPluginTest.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22
/**
3-
* Tests for Frameright\Admin 's AdminPlugin class.
3+
* Tests for FramerightImageDisplayControl\Admin 's AdminPlugin class.
44
*
5-
* @package Frameright\Tests\Admin
5+
* @package FramerightImageDisplayControl\Tests\Admin
66
*/
77

88
require_once __DIR__ . '/../src/admin/admin-plugin.php';
@@ -47,7 +47,7 @@ public function test_constructor() {
4747
->method('add_filter')
4848
->withConsecutive(['wp_handle_upload'], ['wp_read_image_metadata']);
4949

50-
new Frameright\Admin\AdminPlugin(
50+
new FramerightImageDisplayControl\Admin\AdminPlugin(
5151
$this->global_functions_mock,
5252
$this->filesystem_mock,
5353
$this->xmp_mock
@@ -109,7 +109,7 @@ public function test_populate_image_metadata() {
109109
],
110110
];
111111

112-
$actual_meta = (new Frameright\Admin\AdminPlugin(
112+
$actual_meta = (new FramerightImageDisplayControl\Admin\AdminPlugin(
113113
$this->global_functions_mock,
114114
$this->filesystem_mock,
115115
$this->xmp_mock
@@ -239,17 +239,17 @@ public function test_create_hardcrops_and_set_attachment_meta() {
239239
->willReturn(83);
240240

241241
$create_hardcrops_method = new ReflectionMethod(
242-
'Frameright\Admin\AdminPlugin',
242+
'FramerightImageDisplayControl\Admin\AdminPlugin',
243243
'create_hardcrops'
244244
);
245245
$create_hardcrops_method->setAccessible(true);
246246
$set_attachment_meta_method = new ReflectionMethod(
247-
'Frameright\Admin\AdminPlugin',
247+
'FramerightImageDisplayControl\Admin\AdminPlugin',
248248
'set_attachment_meta'
249249
);
250250
$set_attachment_meta_method->setAccessible(true);
251251

252-
$plugin_under_test = new Frameright\Admin\AdminPlugin(
252+
$plugin_under_test = new FramerightImageDisplayControl\Admin\AdminPlugin(
253253
$this->global_functions_mock,
254254
$this->filesystem_mock,
255255
$this->xmp_mock
@@ -305,12 +305,12 @@ public function test_read_rectangle_cropping_metadata() {
305305
];
306306

307307
$method = new ReflectionMethod(
308-
'Frameright\Admin\AdminPlugin',
308+
'FramerightImageDisplayControl\Admin\AdminPlugin',
309309
'read_rectangle_cropping_metadata'
310310
);
311311
$method->setAccessible(true);
312312
$actual_result = $method->invoke(
313-
new Frameright\Admin\AdminPlugin(
313+
new FramerightImageDisplayControl\Admin\AdminPlugin(
314314
$this->global_functions_mock,
315315
$this->filesystem_mock,
316316
$this->xmp_mock
@@ -350,12 +350,12 @@ public function test_absolute() {
350350
];
351351

352352
$method = new ReflectionMethod(
353-
'Frameright\Admin\AdminPlugin',
353+
'FramerightImageDisplayControl\Admin\AdminPlugin',
354354
'absolute'
355355
);
356356
$method->setAccessible(true);
357357
$actual_result = $method->invoke(
358-
new Frameright\Admin\AdminPlugin(
358+
new FramerightImageDisplayControl\Admin\AdminPlugin(
359359
$this->global_functions_mock,
360360
$this->filesystem_mock,
361361
$this->xmp_mock

tests/FilesystemTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22
/**
3-
* Tests for Frameright\Admin 's Filesystem class.
3+
* Tests for FramerightImageDisplayControl\Admin 's Filesystem class.
44
*
5-
* @package Frameright\Tests\Admin
5+
* @package FramerightImageDisplayControl\Tests\Admin
66
*/
77

88
require_once __DIR__ . '/../src/admin/filesystem.php';
@@ -27,7 +27,7 @@ protected function setUp(): void {
2727
*/
2828
public function test_basename_to_name_and_extension() {
2929
$method = new ReflectionMethod(
30-
'Frameright\Admin\Filesystem',
30+
'FramerightImageDisplayControl\Admin\Filesystem',
3131
'basename_to_name_and_extension'
3232
);
3333
$method->setAccessible(true);
@@ -48,7 +48,7 @@ public function test_basename_to_name_and_extension() {
4848
*/
4949
public function test_name_and_extension_to_basename() {
5050
$method = new ReflectionMethod(
51-
'Frameright\Admin\Filesystem',
51+
'FramerightImageDisplayControl\Admin\Filesystem',
5252
'name_and_extension_to_basename'
5353
);
5454
$method->setAccessible(true);
@@ -86,7 +86,7 @@ public function test_unique_target_file() {
8686
->with('/absolute/path/to', 'img-frameright.jpg')
8787
->willReturn('img-frameright.jpg');
8888

89-
$actual_result = (new Frameright\Admin\Filesystem(
89+
$actual_result = (new FramerightImageDisplayControl\Admin\Filesystem(
9090
$this->global_functions_mock
9191
))->unique_target_file($input_source_path, '-frameright');
9292

@@ -109,7 +109,7 @@ public function test_image_title_with_metadata() {
109109
'title' => $expected_result,
110110
]);
111111

112-
$actual_result = (new Frameright\Admin\Filesystem(
112+
$actual_result = (new FramerightImageDisplayControl\Admin\Filesystem(
113113
$this->global_functions_mock
114114
))->image_title($input_path);
115115

@@ -132,7 +132,7 @@ public function test_image_title_without_metadata() {
132132
'title' => '',
133133
]);
134134

135-
$actual_result = (new Frameright\Admin\Filesystem(
135+
$actual_result = (new FramerightImageDisplayControl\Admin\Filesystem(
136136
$this->global_functions_mock
137137
))->image_title($input_path);
138138

tests/RenderPluginTest.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22
/**
3-
* Tests for Frameright\Render 's RenderPlugin class.
3+
* Tests for FramerightImageDisplayControl\Render 's RenderPlugin class.
44
*
5-
* @package Frameright\Tests\Render
5+
* @package FramerightImageDisplayControl\Tests\Render
66
*/
77

88
require_once __DIR__ . '/../src/render/render-plugin.php';
@@ -38,7 +38,9 @@ public function test_constructor() {
3838
->method('add_filter')
3939
->with('wp_calculate_image_srcset');
4040

41-
new Frameright\Render\RenderPlugin($this->global_functions_mock);
41+
new FramerightImageDisplayControl\Render\RenderPlugin(
42+
$this->global_functions_mock
43+
);
4244
}
4345

4446
/**
@@ -132,7 +134,7 @@ public function test_replace_srcsets_with_better_hardcrop() {
132134
],
133135
];
134136

135-
$actual_srcsets = (new Frameright\Render\RenderPlugin(
137+
$actual_srcsets = (new FramerightImageDisplayControl\Render\RenderPlugin(
136138
$this->global_functions_mock
137139
))->replace_srcsets(
138140
null,
@@ -160,7 +162,7 @@ public function test_replace_srcsets_without_hardcrop() {
160162

161163
$expected_srcsets = null;
162164

163-
$actual_srcsets = (new Frameright\Render\RenderPlugin(
165+
$actual_srcsets = (new FramerightImageDisplayControl\Render\RenderPlugin(
164166
$this->global_functions_mock
165167
))->replace_srcsets(null, null, null, null, $input_attachment_id);
166168

0 commit comments

Comments
 (0)