DataStore.php
4 weeks ago
DeprecatedNotes.php
1 year ago
Note.php
4 weeks ago
NoteTraits.php
5 months ago
Notes.php
4 weeks ago
NotesUnavailableException.php
4 years ago
DeprecatedNotes.php
561 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Define deprecated classes to support changing the naming convention of |
| 4 | * admin notes. |
| 5 | */ |
| 6 | |
| 7 | namespace Automattic\WooCommerce\Admin\Notes; |
| 8 | |
| 9 | defined( 'ABSPATH' ) || exit; |
| 10 | |
| 11 | use Automattic\WooCommerce\Admin\DeprecatedClassFacade; |
| 12 | |
| 13 | // phpcs:disable Generic.Files.OneObjectStructurePerFile.MultipleFound |
| 14 | |
| 15 | /** |
| 16 | * WC_Admin_Note. |
| 17 | * |
| 18 | * @deprecated since 4.8.0, use Note |
| 19 | */ |
| 20 | class WC_Admin_Note extends DeprecatedClassFacade { |
| 21 | // These constants must be redeclared as to not break plugins that use them. |
| 22 | const E_WC_ADMIN_NOTE_ERROR = Note::E_WC_ADMIN_NOTE_ERROR; |
| 23 | const E_WC_ADMIN_NOTE_WARNING = Note::E_WC_ADMIN_NOTE_WARNING; |
| 24 | const E_WC_ADMIN_NOTE_UPDATE = Note::E_WC_ADMIN_NOTE_UPDATE; |
| 25 | const E_WC_ADMIN_NOTE_INFORMATIONAL = Note::E_WC_ADMIN_NOTE_INFORMATIONAL; |
| 26 | const E_WC_ADMIN_NOTE_MARKETING = Note::E_WC_ADMIN_NOTE_MARKETING; |
| 27 | const E_WC_ADMIN_NOTE_SURVEY = Note::E_WC_ADMIN_NOTE_SURVEY; |
| 28 | const E_WC_ADMIN_NOTE_PENDING = Note::E_WC_ADMIN_NOTE_PENDING; |
| 29 | const E_WC_ADMIN_NOTE_UNACTIONED = Note::E_WC_ADMIN_NOTE_UNACTIONED; |
| 30 | const E_WC_ADMIN_NOTE_ACTIONED = Note::E_WC_ADMIN_NOTE_ACTIONED; |
| 31 | const E_WC_ADMIN_NOTE_SNOOZED = Note::E_WC_ADMIN_NOTE_SNOOZED; |
| 32 | const E_WC_ADMIN_NOTE_EMAIL = Note::E_WC_ADMIN_NOTE_EMAIL; |
| 33 | |
| 34 | /** |
| 35 | * The name of the non-deprecated class that this facade covers. |
| 36 | * |
| 37 | * @var string |
| 38 | */ |
| 39 | protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Note'; |
| 40 | |
| 41 | /** |
| 42 | * The version that this class was deprecated in. |
| 43 | * |
| 44 | * @var string |
| 45 | */ |
| 46 | protected static $deprecated_in_version = '4.8.0'; |
| 47 | |
| 48 | /** |
| 49 | * Note constructor. Loads note data. |
| 50 | * |
| 51 | * @param mixed $data Note data, object, or ID. |
| 52 | */ |
| 53 | public function __construct( $data = '' ) { |
| 54 | $this->instance = new static::$facade_over_classname( $data ); |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * WC_Admin_Notes. |
| 60 | * |
| 61 | * @deprecated since 4.8.0, use Notes |
| 62 | */ |
| 63 | class WC_Admin_Notes extends DeprecatedClassFacade { |
| 64 | /** |
| 65 | * The name of the non-deprecated class that this facade covers. |
| 66 | * |
| 67 | * @var string |
| 68 | */ |
| 69 | protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Notes'; |
| 70 | |
| 71 | /** |
| 72 | * The version that this class was deprecated in. |
| 73 | * |
| 74 | * @var string |
| 75 | */ |
| 76 | protected static $deprecated_in_version = '4.8.0'; |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * WC_Admin_Notes_Customize_Store_With_Blocks. |
| 81 | * |
| 82 | * @deprecated since 4.8.0, use CustomizeStoreWithBlocks |
| 83 | */ |
| 84 | class WC_Admin_Notes_Customize_Store_With_Blocks extends DeprecatedClassFacade { |
| 85 | /** |
| 86 | * The name of the non-deprecated class that this facade covers. |
| 87 | * |
| 88 | * @var string |
| 89 | */ |
| 90 | protected static $facade_over_classname = 'Automattic\WooCommerce\Internal\Admin\Notes\CustomizeStoreWithBlocks'; |
| 91 | |
| 92 | /** |
| 93 | * The version that this class was deprecated in. |
| 94 | * |
| 95 | * @var string |
| 96 | */ |
| 97 | protected static $deprecated_in_version = '4.8.0'; |
| 98 | } |
| 99 | |
| 100 | /** |
| 101 | * WC_Admin_Notes_Edit_Products_On_The_Move. |
| 102 | * |
| 103 | * @deprecated since 4.8.0, use EditProductsOnTheMove |
| 104 | */ |
| 105 | class WC_Admin_Notes_Edit_Products_On_The_Move extends DeprecatedClassFacade { |
| 106 | /** |
| 107 | * The name of the non-deprecated class that this facade covers. |
| 108 | * |
| 109 | * @var string |
| 110 | */ |
| 111 | protected static $facade_over_classname = 'Automattic\WooCommerce\Internal\Admin\Notes\EditProductsOnTheMove'; |
| 112 | |
| 113 | /** |
| 114 | * The version that this class was deprecated in. |
| 115 | * |
| 116 | * @var string |
| 117 | */ |
| 118 | protected static $deprecated_in_version = '4.8.0'; |
| 119 | } |
| 120 | |
| 121 | /** |
| 122 | * WC_Admin_Notes_EU_VAT_Number. |
| 123 | * |
| 124 | * @deprecated since 4.8.0, use EUVATNumber |
| 125 | */ |
| 126 | class WC_Admin_Notes_EU_VAT_Number extends DeprecatedClassFacade { |
| 127 | /** |
| 128 | * The name of the non-deprecated class that this facade covers. |
| 129 | * |
| 130 | * @var string |
| 131 | */ |
| 132 | protected static $facade_over_classname = 'Automattic\WooCommerce\Internal\Admin\Notes\EUVATNumber'; |
| 133 | |
| 134 | /** |
| 135 | * The version that this class was deprecated in. |
| 136 | * |
| 137 | * @var string |
| 138 | */ |
| 139 | protected static $deprecated_in_version = '4.8.0'; |
| 140 | } |
| 141 | |
| 142 | /** |
| 143 | * WC_Admin_Notes_Facebook_Marketing_Expert. |
| 144 | * |
| 145 | * @deprecated since 4.8.0, use FacebookMarketingExpert |
| 146 | */ |
| 147 | class WC_Admin_Notes_Facebook_Marketing_Expert extends DeprecatedClassFacade { |
| 148 | /** |
| 149 | * The name of the non-deprecated class that this facade covers. |
| 150 | * |
| 151 | * @var string |
| 152 | */ |
| 153 | protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\FacebookMarketingExpert'; |
| 154 | |
| 155 | /** |
| 156 | * The version that this class was deprecated in. |
| 157 | * |
| 158 | * @var string |
| 159 | */ |
| 160 | protected static $deprecated_in_version = '4.8.0'; |
| 161 | } |
| 162 | |
| 163 | /** |
| 164 | * WC_Admin_Notes_First_Product. |
| 165 | * |
| 166 | * @deprecated since 4.8.0, use FirstProduct |
| 167 | */ |
| 168 | class WC_Admin_Notes_First_Product extends DeprecatedClassFacade { |
| 169 | /** |
| 170 | * The name of the non-deprecated class that this facade covers. |
| 171 | * |
| 172 | * @var string |
| 173 | */ |
| 174 | protected static $facade_over_classname = 'Automattic\WooCommerce\Internal\Admin\Notes\FirstProduct'; |
| 175 | |
| 176 | /** |
| 177 | * The version that this class was deprecated in. |
| 178 | * |
| 179 | * @var string |
| 180 | */ |
| 181 | protected static $deprecated_in_version = '4.8.0'; |
| 182 | } |
| 183 | |
| 184 | /** |
| 185 | * WC_Admin_Notes_Giving_Feedback_Notes. |
| 186 | * |
| 187 | * @deprecated since 4.8.0, use GivingFeedbackNotes |
| 188 | */ |
| 189 | class WC_Admin_Notes_Giving_Feedback_Notes extends DeprecatedClassFacade { |
| 190 | /** |
| 191 | * The name of the non-deprecated class that this facade covers. |
| 192 | * |
| 193 | * @var string |
| 194 | */ |
| 195 | protected static $facade_over_classname = 'Automattic\WooCommerce\Internal\Admin\Notes\GivingFeedbackNotes'; |
| 196 | |
| 197 | /** |
| 198 | * The version that this class was deprecated in. |
| 199 | * |
| 200 | * @var string |
| 201 | */ |
| 202 | protected static $deprecated_in_version = '4.8.0'; |
| 203 | } |
| 204 | |
| 205 | /** |
| 206 | * WC_Admin_Notes_Install_JP_And_WCS_Plugins. |
| 207 | * |
| 208 | * @deprecated since 4.8.0, use InstallJPAndWCSPlugins |
| 209 | */ |
| 210 | class WC_Admin_Notes_Install_JP_And_WCS_Plugins extends DeprecatedClassFacade { |
| 211 | /** |
| 212 | * The name of the non-deprecated class that this facade covers. |
| 213 | * |
| 214 | * @var string |
| 215 | */ |
| 216 | protected static $facade_over_classname = 'Automattic\WooCommerce\Internal\Admin\Notes\InstallJPAndWCSPlugins'; |
| 217 | |
| 218 | /** |
| 219 | * The version that this class was deprecated in. |
| 220 | * |
| 221 | * @var string |
| 222 | */ |
| 223 | protected static $deprecated_in_version = '4.8.0'; |
| 224 | } |
| 225 | |
| 226 | /** |
| 227 | * WC_Admin_Notes_Launch_Checklist. |
| 228 | * |
| 229 | * @deprecated since 4.8.0, use LaunchChecklist |
| 230 | */ |
| 231 | class WC_Admin_Notes_Launch_Checklist extends DeprecatedClassFacade { |
| 232 | /** |
| 233 | * The name of the non-deprecated class that this facade covers. |
| 234 | * |
| 235 | * @var string |
| 236 | */ |
| 237 | protected static $facade_over_classname = 'Automattic\WooCommerce\Internal\Admin\Notes\LaunchChecklist'; |
| 238 | |
| 239 | /** |
| 240 | * The version that this class was deprecated in. |
| 241 | * |
| 242 | * @var string |
| 243 | */ |
| 244 | protected static $deprecated_in_version = '4.8.0'; |
| 245 | } |
| 246 | |
| 247 | /** |
| 248 | * WC_Admin_Notes_Migrate_From_Shopify. |
| 249 | * |
| 250 | * @deprecated since 4.8.0, use MigrateFromShopify |
| 251 | */ |
| 252 | class WC_Admin_Notes_Migrate_From_Shopify extends DeprecatedClassFacade { |
| 253 | /** |
| 254 | * The name of the non-deprecated class that this facade covers. |
| 255 | * |
| 256 | * @var string |
| 257 | */ |
| 258 | protected static $facade_over_classname = 'Automattic\WooCommerce\Internal\Admin\Notes\MigrateFromShopify'; |
| 259 | |
| 260 | /** |
| 261 | * The version that this class was deprecated in. |
| 262 | * |
| 263 | * @var string |
| 264 | */ |
| 265 | protected static $deprecated_in_version = '4.8.0'; |
| 266 | } |
| 267 | |
| 268 | /** |
| 269 | * WC_Admin_Notes_Mobile_App. |
| 270 | * |
| 271 | * @deprecated since 4.8.0, use MobileApp |
| 272 | */ |
| 273 | class WC_Admin_Notes_Mobile_App extends DeprecatedClassFacade { |
| 274 | /** |
| 275 | * The name of the non-deprecated class that this facade covers. |
| 276 | * |
| 277 | * @var string |
| 278 | */ |
| 279 | protected static $facade_over_classname = 'Automattic\WooCommerce\Internal\Admin\Notes\MobileApp'; |
| 280 | |
| 281 | /** |
| 282 | * The version that this class was deprecated in. |
| 283 | * |
| 284 | * @var string |
| 285 | */ |
| 286 | protected static $deprecated_in_version = '4.8.0'; |
| 287 | } |
| 288 | |
| 289 | /** |
| 290 | * WC_Admin_Notes_New_Sales_Record. |
| 291 | * |
| 292 | * @deprecated since 4.8.0, use NewSalesRecord |
| 293 | */ |
| 294 | class WC_Admin_Notes_New_Sales_Record extends DeprecatedClassFacade { |
| 295 | /** |
| 296 | * The name of the non-deprecated class that this facade covers. |
| 297 | * |
| 298 | * @var string |
| 299 | */ |
| 300 | protected static $facade_over_classname = 'Automattic\WooCommerce\Internal\Admin\Notes\NewSalesRecord'; |
| 301 | |
| 302 | /** |
| 303 | * The version that this class was deprecated in. |
| 304 | * |
| 305 | * @var string |
| 306 | */ |
| 307 | protected static $deprecated_in_version = '4.8.0'; |
| 308 | } |
| 309 | |
| 310 | /** |
| 311 | * WC_Admin_Notes_Onboarding_Email_Marketing. |
| 312 | * |
| 313 | * @deprecated since 4.8.0, use OnboardingEmailMarketing |
| 314 | */ |
| 315 | class WC_Admin_Notes_Onboarding_Email_Marketing extends DeprecatedClassFacade { |
| 316 | /** |
| 317 | * The name of the non-deprecated class that this facade covers. |
| 318 | * |
| 319 | * @var string |
| 320 | */ |
| 321 | protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\OnboardingEmailMarketing'; |
| 322 | |
| 323 | /** |
| 324 | * The version that this class was deprecated in. |
| 325 | * |
| 326 | * @var string |
| 327 | */ |
| 328 | protected static $deprecated_in_version = '4.8.0'; |
| 329 | } |
| 330 | |
| 331 | /** |
| 332 | * WC_Admin_Notes_Onboarding_Payments. |
| 333 | * |
| 334 | * @deprecated since 4.8.0, use OnboardingPayments |
| 335 | */ |
| 336 | class WC_Admin_Notes_Onboarding_Payments extends DeprecatedClassFacade { |
| 337 | /** |
| 338 | * The name of the non-deprecated class that this facade covers. |
| 339 | * |
| 340 | * @var string |
| 341 | */ |
| 342 | protected static $facade_over_classname = 'Automattic\WooCommerce\Internal\Admin\Notes\OnboardingPayments'; |
| 343 | |
| 344 | /** |
| 345 | * The version that this class was deprecated in. |
| 346 | * |
| 347 | * @var string |
| 348 | */ |
| 349 | protected static $deprecated_in_version = '4.8.0'; |
| 350 | } |
| 351 | |
| 352 | /** |
| 353 | * WC_Admin_Notes_Online_Clothing_Store. |
| 354 | * |
| 355 | * @deprecated since 4.8.0, use OnlineClothingStore |
| 356 | */ |
| 357 | class WC_Admin_Notes_Online_Clothing_Store extends DeprecatedClassFacade { |
| 358 | /** |
| 359 | * The name of the non-deprecated class that this facade covers. |
| 360 | * |
| 361 | * @var string |
| 362 | */ |
| 363 | protected static $facade_over_classname = 'Automattic\WooCommerce\Internal\Admin\Notes\OnlineClothingStore'; |
| 364 | |
| 365 | /** |
| 366 | * The version that this class was deprecated in. |
| 367 | * |
| 368 | * @var string |
| 369 | */ |
| 370 | protected static $deprecated_in_version = '4.8.0'; |
| 371 | } |
| 372 | |
| 373 | /** |
| 374 | * WC_Admin_Notes_Order_Milestones. |
| 375 | * |
| 376 | * @deprecated since 4.8.0, use OrderMilestones |
| 377 | */ |
| 378 | class WC_Admin_Notes_Order_Milestones extends DeprecatedClassFacade { |
| 379 | /** |
| 380 | * The name of the non-deprecated class that this facade covers. |
| 381 | * |
| 382 | * @var string |
| 383 | */ |
| 384 | protected static $facade_over_classname = 'Automattic\WooCommerce\Internal\Admin\Notes\OrderMilestones'; |
| 385 | |
| 386 | /** |
| 387 | * The version that this class was deprecated in. |
| 388 | * |
| 389 | * @var string |
| 390 | */ |
| 391 | protected static $deprecated_in_version = '4.8.0'; |
| 392 | } |
| 393 | |
| 394 | /** |
| 395 | * WC_Admin_Notes_Performance_On_Mobile. |
| 396 | * |
| 397 | * @deprecated since 4.8.0, use PerformanceOnMobile |
| 398 | */ |
| 399 | class WC_Admin_Notes_Performance_On_Mobile extends DeprecatedClassFacade { |
| 400 | /** |
| 401 | * The name of the non-deprecated class that this facade covers. |
| 402 | * |
| 403 | * @var string |
| 404 | */ |
| 405 | protected static $facade_over_classname = 'Automattic\WooCommerce\Internal\Admin\Notes\PerformanceOnMobile'; |
| 406 | |
| 407 | /** |
| 408 | * The version that this class was deprecated in. |
| 409 | * |
| 410 | * @var string |
| 411 | */ |
| 412 | protected static $deprecated_in_version = '4.8.0'; |
| 413 | } |
| 414 | |
| 415 | /** |
| 416 | * WC_Admin_Notes_Personalize_Store. |
| 417 | * |
| 418 | * @deprecated since 4.8.0, use PersonalizeStore |
| 419 | */ |
| 420 | class WC_Admin_Notes_Personalize_Store extends DeprecatedClassFacade { |
| 421 | /** |
| 422 | * The name of the non-deprecated class that this facade covers. |
| 423 | * |
| 424 | * @var string |
| 425 | */ |
| 426 | protected static $facade_over_classname = 'Automattic\WooCommerce\Internal\Admin\Notes\PersonalizeStore'; |
| 427 | |
| 428 | /** |
| 429 | * The version that this class was deprecated in. |
| 430 | * |
| 431 | * @var string |
| 432 | */ |
| 433 | protected static $deprecated_in_version = '4.8.0'; |
| 434 | } |
| 435 | |
| 436 | /** |
| 437 | * WC_Admin_Notes_Real_Time_Order_Alerts. |
| 438 | * |
| 439 | * @deprecated since 4.8.0, use RealTimeOrderAlerts |
| 440 | */ |
| 441 | class WC_Admin_Notes_Real_Time_Order_Alerts extends DeprecatedClassFacade { |
| 442 | /** |
| 443 | * The name of the non-deprecated class that this facade covers. |
| 444 | * |
| 445 | * @var string |
| 446 | */ |
| 447 | protected static $facade_over_classname = 'Automattic\WooCommerce\Internal\Admin\Notes\RealTimeOrderAlerts'; |
| 448 | |
| 449 | /** |
| 450 | * The version that this class was deprecated in. |
| 451 | * |
| 452 | * @var string |
| 453 | */ |
| 454 | protected static $deprecated_in_version = '4.8.0'; |
| 455 | } |
| 456 | |
| 457 | /** |
| 458 | * WC_Admin_Notes_Selling_Online_Courses. |
| 459 | * |
| 460 | * @deprecated since 4.8.0, use SellingOnlineCourses |
| 461 | */ |
| 462 | class WC_Admin_Notes_Selling_Online_Courses extends DeprecatedClassFacade { |
| 463 | /** |
| 464 | * The name of the non-deprecated class that this facade covers. |
| 465 | * |
| 466 | * @var string |
| 467 | */ |
| 468 | protected static $facade_over_classname = 'Automattic\WooCommerce\Internal\Admin\Notes\SellingOnlineCourses'; |
| 469 | |
| 470 | /** |
| 471 | * The version that this class was deprecated in. |
| 472 | * |
| 473 | * @var string |
| 474 | */ |
| 475 | protected static $deprecated_in_version = '4.8.0'; |
| 476 | } |
| 477 | |
| 478 | /** |
| 479 | * WC_Admin_Notes_Tracking_Opt_In. |
| 480 | * |
| 481 | * @deprecated since 4.8.0, use TrackingOptIn |
| 482 | */ |
| 483 | class WC_Admin_Notes_Tracking_Opt_In extends DeprecatedClassFacade { |
| 484 | /** |
| 485 | * The name of the non-deprecated class that this facade covers. |
| 486 | * |
| 487 | * @var string |
| 488 | */ |
| 489 | protected static $facade_over_classname = 'Automattic\WooCommerce\Internal\Admin\Notes\TrackingOptIn'; |
| 490 | |
| 491 | /** |
| 492 | * The version that this class was deprecated in. |
| 493 | * |
| 494 | * @var string |
| 495 | */ |
| 496 | protected static $deprecated_in_version = '4.8.0'; |
| 497 | } |
| 498 | |
| 499 | /** |
| 500 | * WC_Admin_Notes_Woo_Subscriptions_Notes. |
| 501 | * |
| 502 | * @deprecated since 4.8.0, use WooSubscriptionsNotes |
| 503 | */ |
| 504 | class WC_Admin_Notes_Woo_Subscriptions_Notes extends DeprecatedClassFacade { |
| 505 | /** |
| 506 | * The name of the non-deprecated class that this facade covers. |
| 507 | * |
| 508 | * @var string |
| 509 | */ |
| 510 | protected static $facade_over_classname = 'Automattic\WooCommerce\Internal\Admin\Notes\WooSubscriptionsNotes'; |
| 511 | |
| 512 | /** |
| 513 | * The version that this class was deprecated in. |
| 514 | * |
| 515 | * @var string |
| 516 | */ |
| 517 | protected static $deprecated_in_version = '4.8.0'; |
| 518 | } |
| 519 | |
| 520 | /** |
| 521 | * WC_Admin_Notes_WooCommerce_Payments. |
| 522 | * |
| 523 | * @deprecated since 4.8.0, use WooCommercePayments |
| 524 | */ |
| 525 | class WC_Admin_Notes_WooCommerce_Payments extends DeprecatedClassFacade { |
| 526 | /** |
| 527 | * The name of the non-deprecated class that this facade covers. |
| 528 | * |
| 529 | * @var string |
| 530 | */ |
| 531 | protected static $facade_over_classname = 'Automattic\WooCommerce\Internal\Admin\Notes\WooCommercePayments'; |
| 532 | |
| 533 | /** |
| 534 | * The version that this class was deprecated in. |
| 535 | * |
| 536 | * @var string |
| 537 | */ |
| 538 | protected static $deprecated_in_version = '4.8.0'; |
| 539 | } |
| 540 | |
| 541 | /** |
| 542 | * WC_Admin_Notes_WooCommerce_Subscriptions. |
| 543 | * |
| 544 | * @deprecated since 4.8.0, use WooCommerceSubscriptions |
| 545 | */ |
| 546 | class WC_Admin_Notes_WooCommerce_Subscriptions extends DeprecatedClassFacade { |
| 547 | /** |
| 548 | * The name of the non-deprecated class that this facade covers. |
| 549 | * |
| 550 | * @var string |
| 551 | */ |
| 552 | protected static $facade_over_classname = 'Automattic\WooCommerce\Internal\Admin\Notes\WooCommerceSubscriptions'; |
| 553 | |
| 554 | /** |
| 555 | * The version that this class was deprecated in. |
| 556 | * |
| 557 | * @var string |
| 558 | */ |
| 559 | protected static $deprecated_in_version = '4.8.0'; |
| 560 | } |
| 561 |