| 1 |
<?php |
| 2 |
/** |
| 3 |
* SDK utilities for DecaLog. |
| 4 |
* |
| 5 |
* @package Features |
| 6 |
* @author Pierre Lannoy <https://pierre.lannoy.fr/>. |
| 7 |
* @since 3.0.0 |
| 8 |
*/ |
| 9 |
|
| 10 |
namespace Decalog\Plugin\Feature; |
| 11 |
|
| 12 |
use Decalog\Plugin\Core; |
| 13 |
|
| 14 |
/** |
| 15 |
* SDK utilities for DecaLog. |
| 16 |
* |
| 17 |
* Defines methods and properties for SDK introspection. |
| 18 |
* |
| 19 |
* @package Features |
| 20 |
* @author Pierre Lannoy <https://pierre.lannoy.fr/>. |
| 21 |
* @since 3.0.0 |
| 22 |
*/ |
| 23 |
class SDK { |
| 24 |
|
| 25 |
/** |
| 26 |
* The components' icons. |
| 27 |
* |
| 28 |
* @since 3.1.0 |
| 29 |
* @var array $icons Maintains the icons list. |
| 30 |
*/ |
| 31 |
private static $icons = []; |
| 32 |
|
| 33 |
/** |
| 34 |
* Verify if SDK is present. |
| 35 |
* |
| 36 |
* @retun boolean True if SDK is present, false otherwise. |
| 37 |
* @since 3.0.0 |
| 38 |
*/ |
| 39 |
public static function is_present() { |
| 40 |
return class_exists( '\DecaLog\Engine' ); |
| 41 |
} |
| 42 |
|
| 43 |
/** |
| 44 |
* Get the self-registered components list. |
| 45 |
* |
| 46 |
* @return array The self-registered components list. |
| 47 |
* @since 3.0.0 |
| 48 |
*/ |
| 49 |
public static function get_selfreg() { |
| 50 |
if ( self::is_present() ) { |
| 51 |
$result = \DecaLog\Engine::getLoggers(); |
| 52 |
foreach ( $result as $slug => $loger ) { |
| 53 |
$result[ $slug ]['slug'] = $slug; |
| 54 |
} |
| 55 |
return $result; |
| 56 |
} |
| 57 |
return []; |
| 58 |
} |
| 59 |
|
| 60 |
/** |
| 61 |
* Returns a base64 svg resource for the PHP icon. |
| 62 |
* |
| 63 |
* @param string $color Optional. Color of the icon. |
| 64 |
* @return string The svg resource as a base64. |
| 65 |
* @since 3.1.0 |
| 66 |
*/ |
| 67 |
private static function get_base64_php_icon( $color = '#777BB3' ) { |
| 68 |
$source = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" fill-rule="evenodd" fill="none" width="100%" height="100%" viewBox="0 0 100 100">'; |
| 69 |
$source .= '<g transform="translate(2,24) scale(0.94,0.94)">'; |
| 70 |
$source .= '<path style="fill:' . $color . '" d="m7.579 10.123 14.204 0c4.169 0.035 7.19 1.237 9.063 3.604 1.873 2.367 2.491 5.6 1.855 9.699-0.247 1.873-0.795 3.71-1.643 5.512-0.813 1.802-1.943 3.427-3.392 4.876-1.767 1.837-3.657 3.003-5.671 3.498-2.014 0.495-4.099 0.742-6.254 0.742l-6.36 0-2.014 10.07-7.367 0 7.579-38.001 0 0m6.201 6.042-3.18 15.9c0.212 0.035 0.424 0.053 0.636 0.053 0.247 0 0.495 0 0.742 0 3.392 0.035 6.219-0.3 8.48-1.007 2.261-0.742 3.781-3.321 4.558-7.738 0.636-3.71 0-5.848-1.908-6.413-1.873-0.565-4.222-0.83-7.049-0.795-0.424 0.035-0.83 0.053-1.219 0.053-0.353 0-0.724 0-1.113 0l0.053-0.053"/>'; |
| 71 |
$source .= '<path style="fill:' . $color . '" d="m41.093 0 7.314 0-2.067 10.123 6.572 0c3.604 0.071 6.289 0.813 8.056 2.226 1.802 1.413 2.332 4.099 1.59 8.056l-3.551 17.649-7.42 0 3.392-16.854c0.353-1.767 0.247-3.021-0.318-3.763-0.565-0.742-1.784-1.113-3.657-1.113l-5.883-0.053-4.346 21.783-7.314 0 7.632-38.054 0 0"/>'; |
| 72 |
$source .= '<path style="fill:' . $color . '" d="m70.412 10.123 14.204 0c4.169 0.035 7.19 1.237 9.063 3.604 1.873 2.367 2.491 5.6 1.855 9.699-0.247 1.873-0.795 3.71-1.643 5.512-0.813 1.802-1.943 3.427-3.392 4.876-1.767 1.837-3.657 3.003-5.671 3.498-2.014 0.495-4.099 0.742-6.254 0.742l-6.36 0-2.014 10.07-7.367 0 7.579-38.001 0 0m6.201 6.042-3.18 15.9c0.212 0.035 0.424 0.053 0.636 0.053 0.247 0 0.495 0 0.742 0 3.392 0.035 6.219-0.3 8.48-1.007 2.261-0.742 3.781-3.321 4.558-7.738 0.636-3.71 0-5.848-1.908-6.413-1.873-0.565-4.222-0.83-7.049-0.795-0.424 0.035-0.83 0.053-1.219 0.053-0.353 0-0.724 0-1.113 0l0.053-0.053"/>'; |
| 73 |
$source .= '</g>'; |
| 74 |
$source .= '</svg>'; |
| 75 |
// phpcs:ignore |
| 76 |
return 'data:image/svg+xml;base64,' . base64_encode( $source ); |
| 77 |
} |
| 78 |
|
| 79 |
/** |
| 80 |
* Returns a base64 svg resource for the WordPress icon. |
| 81 |
* |
| 82 |
* @param string $color Optional. Color of the icon. |
| 83 |
* @return string The svg resource as a base64. |
| 84 |
* @since 3.1.0 |
| 85 |
*/ |
| 86 |
private static function get_base64_wordpress_icon( $color = '#0073AA' ) { |
| 87 |
$source = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" fill-rule="evenodd" fill="none" width="100%" height="100%" viewBox="0 0 100 100">'; |
| 88 |
$source .= '<g transform="translate(-54,-26) scale(18,18)">'; |
| 89 |
$source .= '<path style="fill:' . $color . '" d="m5.8465 1.9131c0.57932 0 1.1068 0.222 1.5022 0.58547-0.1938-0.0052-0.3872 0.11-0.3952 0.3738-0.0163 0.5333 0.6377 0.6469 0.2853 1.7196l-0.2915 0.8873-0.7939-2.3386c-0.0123-0.0362 0.002-0.0568 0.0465-0.0568h0.22445c0.011665 0 0.021201-0.00996 0.021201-0.022158v-0.13294c0-0.012193-0.00956-0.022657-0.021201-0.022153-0.42505 0.018587-0.8476 0.018713-1.2676 0-0.0117-0.0005-0.0212 0.01-0.0212 0.0222v0.13294c0 0.012185 0.00954 0.022158 0.021201 0.022158h0.22568c0.050201 0 0.064256 0.016728 0.076091 0.049087l0.3262 0.8921-0.4907 1.4817-0.8066-2.3758c-0.01-0.0298 0.0021-0.0471 0.0308-0.0471h0.25715c0.011661 0 0.021197-0.00996 0.021197-0.022158v-0.13294c0-0.012193-0.00957-0.022764-0.021197-0.022153-0.2698 0.014331-0.54063 0.017213-0.79291 0.019803 0.39589-0.60984 1.0828-1.0134 1.8639-1.0134l-0.0000029-0.0000062zm1.9532 1.1633c0.17065 0.31441 0.26755 0.67464 0.26755 1.0574 0 0.84005-0.46675 1.5712-1.1549 1.9486l0.6926-1.9617c0.1073-0.3036 0.2069-0.7139 0.1947-1.0443h-0.000004zm-1.2097 3.1504c-0.2325 0.0827-0.4827 0.1278-0.7435 0.1278-0.2247 0-0.4415-0.0335-0.6459-0.0955l0.68415-1.9606 0.70524 1.9284v-1e-7zm-1.6938-0.0854c-0.75101-0.35617-1.2705-1.1213-1.2705-2.0075 0-0.32852 0.071465-0.64038 0.19955-0.92096l1.071 2.9285 0.000003-0.000003zm0.95023-4.4367c1.3413 0 2.4291 1.0878 2.4291 2.4291s-1.0878 2.4291-2.4291 2.4291-2.4291-1.0878-2.4291-2.4291 1.0878-2.4291 2.4291-2.4291zm0-0.15354c1.4261 0 2.5827 1.1566 2.5827 2.5827s-1.1566 2.5827-2.5827 2.5827-2.5827-1.1566-2.5827-2.5827 1.1566-2.5827 2.5827-2.5827z"/>'; |
| 90 |
$source .= '</g>'; |
| 91 |
$source .= '</svg>'; |
| 92 |
// phpcs:ignore |
| 93 |
return 'data:image/svg+xml;base64,' . base64_encode( $source ); |
| 94 |
} |
| 95 |
|
| 96 |
/** |
| 97 |
* Returns a base64 svg resource for the Jetpack icon. |
| 98 |
* |
| 99 |
* @param string $color Optional. Color of the icon. |
| 100 |
* @return string The svg resource as a base64. |
| 101 |
* @since 3.1.0 |
| 102 |
*/ |
| 103 |
private static function get_base64_jetpack_icon( $color = '#00be28' ) { |
| 104 |
$source = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" fill-rule="evenodd" fill="none" width="100%" height="100%" viewBox="0 0 100 100">'; |
| 105 |
$source .= '<g transform="translate(6,2) scale(0.19,0.19)">'; |
| 106 |
$source .= '<path style="fill:#FFFFFF" d="M252.1 447.56S387.8 188.22 387.35 187.9c.44.32-145.7-.23-146.15-.54.45.3-1.2-161.78-1.2-161.78s-24.73.55-25.16.24c.43.3-130.88 262.4-131.32 262.1.44.3 131.75-.25 131.32-.56.43.3 9.23 156.9 8.8 156.6.43.3 28.45 3.6 28.45 3.6z"/>'; |
| 107 |
$source .= '<path style="fill:' . $color . '" d="M240 0C107.63 0 0 107.63 0 240s107.63 240 240 240 240-107.63 240-240S372.37 0 240 0zm-12.37 279.85H108.1L227.62 47.18v232.67zm24.28 152.52V199.7h119.55L251.9 432.36z"/>'; |
| 108 |
$source .= '</g>'; |
| 109 |
$source .= '</svg>'; |
| 110 |
// phpcs:ignore |
| 111 |
return 'data:image/svg+xml;base64,' . base64_encode( $source ); |
| 112 |
} |
| 113 |
|
| 114 |
/** |
| 115 |
* Returns a base64 svg resource for the Stripe icon. |
| 116 |
* |
| 117 |
* @param string $color Optional. Color of the icon. |
| 118 |
* @return string The svg resource as a base64. |
| 119 |
* @since 3.1.0 |
| 120 |
*/ |
| 121 |
private static function get_base64_stripe_icon( $color = '#6772e5' ) { |
| 122 |
$source = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" fill-rule="evenodd" viewBox="0 0 32 32" width="64" height="64" fill="' . $color . '">'; |
| 123 |
$source .= '<g transform="translate(0,0) scale(0.8,0.8)">'; |
| 124 |
$source .= '<path d="M111.328 15.602c0-4.97-2.415-8.9-7.013-8.9s-7.423 3.924-7.423 8.863c0 5.85 3.32 8.8 8.036 8.8 2.318 0 4.06-.528 5.377-1.26V19.22a10.246 10.246 0 0 1-4.764 1.075c-1.9 0-3.556-.67-3.774-2.943h9.497a39.64 39.64 0 0 0 .063-1.748zm-9.606-1.835c0-2.186 1.35-3.1 2.56-3.1s2.454.906 2.454 3.1zM89.4 6.712a5.434 5.434 0 0 0-3.801 1.509l-.254-1.208h-4.27v22.64l4.85-1.032v-5.488a5.434 5.434 0 0 0 3.444 1.265c3.472 0 6.64-2.792 6.64-8.957.003-5.66-3.206-8.73-6.614-8.73zM88.23 20.1a2.898 2.898 0 0 1-2.288-.906l-.03-7.2a2.928 2.928 0 0 1 2.315-.96c1.775 0 2.998 2 2.998 4.528.003 2.593-1.198 4.546-2.995 4.546zM79.25.57l-4.87 1.035v3.95l4.87-1.032z" fill-rule="evenodd"/>'; |
| 125 |
$source .= '<path d="M74.38 7.035h4.87V24.04h-4.87z"/>'; |
| 126 |
$source .= '<path d="M69.164 8.47l-.302-1.434h-4.196V24.04h4.848V12.5c1.147-1.5 3.082-1.208 3.698-1.017V7.038c-.646-.232-2.913-.658-4.048 1.43zm-9.73-5.646L54.698 3.83l-.02 15.562c0 2.87 2.158 4.993 5.038 4.993 1.585 0 2.756-.302 3.405-.643v-3.95c-.622.248-3.683 1.138-3.683-1.72v-6.9h3.683V7.035h-3.683zM46.3 11.97c0-.758.63-1.05 1.648-1.05a10.868 10.868 0 0 1 4.83 1.25V7.6a12.815 12.815 0 0 0-4.83-.888c-3.924 0-6.557 2.056-6.557 5.488 0 5.37 7.375 4.498 7.375 6.813 0 .906-.78 1.186-1.863 1.186-1.606 0-3.68-.664-5.307-1.55v4.63a13.461 13.461 0 0 0 5.307 1.117c4.033 0 6.813-1.992 6.813-5.485 0-5.796-7.417-4.76-7.417-6.943zM13.88 9.515c0-1.37 1.14-1.9 2.982-1.9A19.661 19.661 0 0 1 25.6 9.876v-8.27A23.184 23.184 0 0 0 16.862.001C9.762.001 5 3.72 5 9.93c0 9.716 13.342 8.138 13.342 12.326 0 1.638-1.4 2.146-3.37 2.146-2.905 0-6.657-1.202-9.6-2.802v8.378A24.353 24.353 0 0 0 14.973 32C22.27 32 27.3 28.395 27.3 22.077c0-10.486-13.42-8.613-13.42-12.56z" fill-rule="evenodd"/>'; |
| 127 |
$source .= '</g>'; |
| 128 |
$source .= '</svg>'; |
| 129 |
// phpcs:ignore |
| 130 |
return 'data:image/svg+xml;base64,' . base64_encode( $source ); |
| 131 |
} |
| 132 |
|
| 133 |
/** |
| 134 |
* Returns a base64 svg resource for the Amelia Stripe Gateway icon. |
| 135 |
* |
| 136 |
* @param string $color1 Optional. Color 1 of the icon. |
| 137 |
* @param string $color2 Optional. Color 2 of the icon. |
| 138 |
* @param string $color3 Optional. Color 3 of the icon. |
| 139 |
* @return string The svg resource as a base64. |
| 140 |
* @since 3.1.0 |
| 141 |
*/ |
| 142 |
private static function get_base64_amelia_icon( $color1 = '#2287ef', $color2 = '#47aafc', $color3 = '#045af7' ) { |
| 143 |
$source = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" fill-rule="evenodd" fill="none" width="100%" height="100%" viewBox="0 0 100 100">'; |
| 144 |
$source .= '<g transform="scale(0.19,-0.19) translate(0,-500)">'; |
| 145 |
$source .= '<path d="M 160.828851 299.768638 C 178.594187 305.690418 197.957501 291.093660 203.211658 272.522544 L 203.211658 104.553794 C 200.572806 97.322965 198.754575 90.919519 193.934314 86.975669 C 179.769999 75.386684 102.709908 33.122263 82.117908 22.034263 C 68.450725 14.675011 53.817422 1.887280 37.684314 1.038169 C 24.223960 0.329730 8.218195 9.553713 3.797595 22.815501 C 1.137674 30.795277 1.063220 39.092885 1.063220 49.866294 C 3.541358 74.794601 3.118697 148.405207 1.063220 174.866294 C 1.063220 187.357829 -0.055376 199.595042 7.117909 208.362391 C 9.552013 211.337405 12.333874 214.316787 15.321031 216.760827 C 23.296875 223.286515 152.092726 296.856598 160.828851 299.768638 Z" transform="scale(1.000000,1.000000) translate(26.280530,182.555581)" fill="' . $color1 . '"></path>'; |
| 146 |
$source .= '<path d="M 1.000000 126.000000 C 3.055476 99.538913 3.478138 25.928307 1.000000 1.000000 L 1.000000 63.500000 Z" transform="scale(1.000000,1.000000) translate(26.343750,231.421875)" fill="' . $color1 . '"></path>'; |
| 147 |
$source .= '<path d="M 160.593453 224.609420 C 169.072913 224.609420 175.331379 224.742351 181.589546 222.656295 C 194.858336 218.233366 283.135777 164.597147 304.441097 153.125034 C 320.363504 144.551448 339.436521 133.858198 338.327828 112.793014 C 337.285097 92.981140 322.558481 83.493534 306.784871 75.000034 C 284.278175 62.881062 191.041144 4.252993 175.241890 1.464889 C 157.432522 -1.677941 142.687647 11.857679 128.073918 19.726620 C 112.808495 27.946453 16.023154 82.241781 10.202828 89.355514 C 2.413027 98.876382 -0.477217 109.889949 1.706737 122.265682 C 4.717603 139.327262 24.812870 147.853470 38.230168 155.078159 C 55.884186 164.584178 149.316420 221.151773 160.593453 224.609420 Z" transform="scale(1.000000,1.000000) translate(78.664360,13.671830)" fill="' . $color2 . '"></path>'; |
| 148 |
$source .= '<path d="M 88.109387 275.187111 C 103.151320 267.087601 187.780525 220.315600 194.261713 212.394143 C 201.849066 203.120717 203.148438 193.891732 203.148438 179.776954 C 200.662690 154.742107 201.074198 67.941437 203.148438 41.105079 C 203.148438 24.693892 199.850790 23.767596 193.382812 10.831641 C 185.126721 2.791197 171.674629 -0.244442 162.035150 1.456635 C 147.460655 4.028612 57.947465 59.381864 36.937488 70.694925 C 23.829804 77.752912 1.000000 88.012442 1.000000 108.487891 L 1.000000 272.550391 C 6.931916 290.083865 22.083569 303.555175 40.062500 300.382423 C 56.170965 297.539752 73.693022 282.949761 88.109387 275.187111 Z" transform="scale(1.000000,1.000000) translate(265.601562,182.527734)" fill="' . $color3 . '"></path>'; |
| 149 |
$source .= '<path d="M 2.713463 139.671875 L 2.713463 70.335938 L 2.713463 1.000000 C 0.639223 27.836358 0.227715 114.637028 2.713463 139.671875 Z" transform="scale(1.000000,1.000000) translate(466.036537,222.632812)" fill="' . $color3 . '"></path>'; |
| 150 |
$source .= '</g>'; |
| 151 |
$source .= '</svg>'; |
| 152 |
// phpcs:ignore |
| 153 |
return 'data:image/svg+xml;base64,' . base64_encode( $source ); |
| 154 |
} |
| 155 |
|
| 156 |
/** |
| 157 |
* Returns a base64 svg resource for the WooCommerce icon. |
| 158 |
* |
| 159 |
* @param string $color1 Optional. Color 1 of the icon. |
| 160 |
* @param string $color2 Optional. Color 2 of the icon. |
| 161 |
* @return string The svg resource as a base64. |
| 162 |
* @since 3.1.0 |
| 163 |
*/ |
| 164 |
private static function get_base64_woo_icon( $color1 = '#7f54b3', $color2 = '#fff' ) { |
| 165 |
$source = '<svg preserveAspectRatio="xMidYMid" version="1.1" viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">'; |
| 166 |
$source .= '<g transform="scale(1,1) translate(0,40)">'; |
| 167 |
$source .= '<path d="m23.759 0h208.38c13.187 0 23.863 10.675 23.863 23.863v79.542c0 13.187-10.675 23.863-23.863 23.863h-74.727l10.257 25.118-45.109-25.118h-98.695c-13.187 0-23.863-10.675-23.863-23.863v-79.542c-0.10466-13.083 10.571-23.863 23.758-23.863z" fill="' . $color1 . '"/>'; |
| 168 |
$source .= '<path d="m14.578 21.75c1.4569-1.9772 3.6423-3.0179 6.5561-3.226 5.3073-0.41626 8.3252 2.0813 9.0537 7.4927 3.226 21.75 6.7642 40.169 10.511 55.259l22.79-43.395c2.0813-3.9545 4.6829-6.0358 7.8049-6.2439 4.5789-0.3122 7.3886 2.6016 8.5333 8.7415 2.6016 13.841 5.9317 25.6 9.8862 35.59 2.7057-26.433 7.2846-45.476 13.737-57.236 1.561-2.9138 3.8504-4.3707 6.8683-4.5789 2.3935-0.20813 4.5789 0.52033 6.5561 2.0813 1.9772 1.561 3.0179 3.5382 3.226 5.9317 0.10406 1.8732-0.20813 3.4341-1.0407 4.9951-4.0585 7.4927-7.3886 20.085-10.094 37.567-2.6016 16.963-3.5382 30.179-2.9138 39.649 0.20813 2.6016-0.20813 4.8911-1.2488 6.8683-1.2488 2.2894-3.122 3.5382-5.5154 3.7463-2.7057 0.20813-5.5154-1.0406-8.2211-3.8504-9.678-9.8862-17.379-24.663-22.998-44.332-6.7642 13.32-11.759 23.311-14.985 29.971-6.1398 11.759-11.343 17.795-15.714 18.107-2.8098 0.20813-5.2033-2.1854-7.2846-7.1805-5.3073-13.633-11.031-39.961-17.171-78.985-0.41626-2.7057 0.20813-5.0992 1.665-6.9724zm223.64 16.338c-3.7463-6.5561-9.2618-10.511-16.65-12.072-1.9772-0.41626-3.8504-0.62439-5.6195-0.62439-9.9902 0-18.107 5.2033-24.455 15.61-5.4114 8.8455-8.1171 18.628-8.1171 29.346 0 8.013 1.665 14.881 4.9951 20.605 3.7463 6.5561 9.2618 10.511 16.65 12.072 1.9772 0.41626 3.8504 0.62439 5.6195 0.62439 10.094 0 18.211-5.2033 24.455-15.61 5.4114-8.9496 8.1171-18.732 8.1171-29.45 0.10406-8.1171-1.665-14.881-4.9951-20.501zm-13.112 28.826c-1.4569 6.8683-4.0585 11.967-7.9089 15.402-3.0179 2.7057-5.8276 3.8504-8.4293 3.3301-2.4976-0.52033-4.5789-2.7057-6.1398-6.7642-1.2488-3.226-1.8732-6.452-1.8732-9.4699 0-2.6016 0.20813-5.2033 0.72846-7.5967 0.93659-4.2667 2.7057-8.4293 5.5154-12.384 3.4341-5.0992 7.0764-7.1805 10.823-6.452 2.4976 0.52033 4.5789 2.7057 6.1398 6.7642 1.2488 3.226 1.8732 6.452 1.8732 9.4699 0 2.7057-0.20813 5.3073-0.72846 7.7008zm-52.033-28.826c-3.7463-6.5561-9.3659-10.511-16.65-12.072-1.9772-0.41626-3.8504-0.62439-5.6195-0.62439-9.9902 0-18.107 5.2033-24.455 15.61-5.4114 8.8455-8.1171 18.628-8.1171 29.346 0 8.013 1.665 14.881 4.9951 20.605 3.7463 6.5561 9.2618 10.511 16.65 12.072 1.9772 0.41626 3.8504 0.62439 5.6195 0.62439 10.094 0 18.211-5.2033 24.455-15.61 5.4114-8.9496 8.1171-18.732 8.1171-29.45 0-8.1171-1.665-14.881-4.9951-20.501zm-13.216 28.826c-1.4569 6.8683-4.0585 11.967-7.9089 15.402-3.0179 2.7057-5.8276 3.8504-8.4293 3.3301-2.4976-0.52033-4.5789-2.7057-6.1398-6.7642-1.2488-3.226-1.8732-6.452-1.8732-9.4699 0-2.6016 0.20813-5.2033 0.72846-7.5967 0.93658-4.2667 2.7057-8.4293 5.5154-12.384 3.4341-5.0992 7.0764-7.1805 10.823-6.452 2.4976 0.52033 4.5789 2.7057 6.1398 6.7642 1.2488 3.226 1.8732 6.452 1.8732 9.4699 0.10406 2.7057-0.20813 5.3073-0.72846 7.7008z" fill="' . $color2 . '"/>'; |
| 169 |
$source .= '</g>'; |
| 170 |
$source .= '</svg>'; |
| 171 |
// phpcs:ignore |
| 172 |
return 'data:image/svg+xml;base64,' . base64_encode( $source ); |
| 173 |
} |
| 174 |
|
| 175 |
/** |
| 176 |
* Returns a base64 svg resource for the BuddyPress icon. |
| 177 |
* |
| 178 |
* @param string $color Optional. Color of the icon. |
| 179 |
* @return string The svg resource as a base64. |
| 180 |
* @since 3.1.0 |
| 181 |
*/ |
| 182 |
private static function get_base64_buddypress_icon( $color = '#d84800' ) { |
| 183 |
$source = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet">'; |
| 184 |
$source .= '<g transform="translate(0,-924.36218) matrix(0.02335871,0,0,-0.02334121,-0.11965895,1052.4471)" style="fill:' . $color . '">'; |
| 185 |
$source .= '<path d="M 2515,5484 C 1798,5410 1171,5100 717,4595 332,4168 110,3689 23,3105 -1,2939 -1,2554 24,2385 111,1783 363,1266 774,842 1492,102 2529,-172 3521,116 c 448,130 858,379 1195,726 413,426 667,949 751,1548 24,173 24,548 -1,715 -91,625 -351,1150 -781,1580 -425,425 -943,685 -1555,780 -101,16 -520,29 -615,19 z m 611,-143 C 4158,5186 4999,4440 5275,3435 5501,2611 5302,1716 4747,1055 4319,547 3693,214 3028,141 c -125,-14 -441,-14 -566,0 -140,15 -338,55 -468,95 C 722,621 -58,1879 161,3188 c 41,249 115,474 234,717 310,631 860,1110 1528,1330 213,70 374,102 642,129 96,10 436,-4 561,-23 z" />'; |
| 186 |
$source .= '<path d="M 2575,5090 C 1629,5020 813,4386 516,3490 384,3089 362,2641 456,2222 643,1386 1307,696 2134,479 c 233,-61 337,-73 611,-73 274,0 378,12 611,73 548,144 1038,500 1357,986 193,294 315,629 363,995 20,156 15,513 -10,660 -42,241 -108,448 -215,665 -421,857 -1325,1375 -2276,1305 z m 820,-491 c 270,-48 512,-261 608,-537 26,-76 31,-104 35,-222 4,-115 1,-149 -17,-220 -62,-250 -237,-457 -467,-553 -63,-27 -134,-48 -134,-41 0,2 15,35 34,72 138,274 138,610 0,883 -110,220 -334,412 -564,483 -30,10 -62,20 -70,23 -21,7 77,56 175,88 126,41 255,49 400,24 z m -610,-285 c 310,-84 541,-333 595,-641 18,-101 8,-278 -20,-368 -75,-236 -220,-401 -443,-505 -109,-51 -202,-70 -335,-70 -355,0 -650,217 -765,563 -28,84 -31,104 -31,232 -1,118 3,152 22,220 89,306 335,528 650,585 67,13 257,3 327,-16 z M 4035,2940 c 301,-95 484,-325 565,-710 21,-103 47,-388 37,-414 -6,-14 -30,-16 -182,-16 -96,0 -175,3 -175,6 0,42 -37,236 -60,313 -99,334 -315,586 -567,661 -24,7 -43,17 -43,21 0,5 32,45 72,90 l 72,82 106,-6 c 67,-3 130,-13 175,-27 z m -1703,-510 258,-255 92,90 c 51,49 183,178 293,286 l 200,197 75,-9 c 207,-26 404,-116 547,-252 170,-161 267,-361 308,-632 15,-100 21,-394 9,-454 l -6,-31 -1519,0 c -1074,0 -1520,3 -1524,11 -14,21 -18,297 -6,407 59,561 364,896 866,950 97,10 55,41 407,-308 z" />'; |
| 187 |
$source .= '</g>'; |
| 188 |
$source .= '</svg>'; |
| 189 |
// phpcs:ignore |
| 190 |
return 'data:image/svg+xml;base64,' . base64_encode( $source ); |
| 191 |
} |
| 192 |
|
| 193 |
/** |
| 194 |
* Returns a base64 svg resource for the bbPress icon. |
| 195 |
* |
| 196 |
* @param string $color Optional. Color of the icon. |
| 197 |
* @return string The svg resource as a base64. |
| 198 |
* @since 3.1.0 |
| 199 |
*/ |
| 200 |
private static function get_base64_bbpress_icon( $color = '#4f4d4b' ) { |
| 201 |
$source = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000" preserveAspectRatio="xMidYMid meet">'; |
| 202 |
$source .= '<g transform="scale(56,56) translate(0,-1)">'; |
| 203 |
$source .= '<path d="M4.5 6.2C3.7 7.3 3.3 8.6 3.3 10c0 1 .2 1.9.6 2.8l1-4.6c.3-1.7.4-2-.4-2zm4 6.4c.3-1.3 0-2.3-1.1-2.3c-.8 0-1.6.6-1.8 1.5l-.3 1.7c-.3 1 .3 1.5 1 1.5c1.2 0 1.9-1.1 2.2-2.4zM10 2c-4.4 0-8 3.6-8 8s3.6 8 8 8s8-3.6 8-8s-3.6-8-8-8zm0 15.5c-2.1 0-4-.8-5.3-2.2c-.3-.4-.7-.8-1-1.2c-.7-1.2-1.2-2.6-1.2-4.1c0-4.1 3.4-7.5 7.5-7.5s7.5 3.4 7.5 7.5s-3.4 7.5-7.5 7.5zm3.8-4.9c.3-1.3 0-2.3-1.1-2.3c-.8 0-1.6.6-1.8 1.5l-.4 1.7c-.2 1.1.4 1.6 1.1 1.6c1.1-.1 1.9-1.2 2.2-2.5zM10 3.3c-2 0-3.9.9-5.1 2.3c.6-.1 1.4-.2 1.8-.3c.2 0 .2.1.2.2c0 .2-1 4.8-1 4.8c.5-.3 1.2-.7 1.8-.7c.9 0 1.5.4 1.9.9l.5-2.4c.4-1.6.4-1.9-.4-1.9c-.4 0-.4-.5 0-.6c.6-.1 1.8-.2 2.3-.3c.2 0 .2.1.2.2l-1 4.8c.5-.4 1.2-.7 1.9-.7c1.7 0 2.5 1.3 2.1 3c-.3 1.7-2 3-3.8 3c-1.3 0-2.1-.7-2.3-1.4c-.7.8-1.7 1.3-2.8 1.4c1.1.7 2.4 1.1 3.7 1.1a6.7 6.7 0 0 0 0-13.4z" fill="' . $color . '"/>'; |
| 204 |
$source .= '</g>'; |
| 205 |
$source .= '</svg>'; |
| 206 |
// phpcs:ignore |
| 207 |
return 'data:image/svg+xml;base64,' . base64_encode( $source ); |
| 208 |
} |
| 209 |
|
| 210 |
/** |
| 211 |
* Returns a base64 svg resource for the W3TC icon. |
| 212 |
* |
| 213 |
* @param string $color1 Optional. Color 1 of the icon. |
| 214 |
* @param string $color2 Optional. Color 2 of the icon. |
| 215 |
* @param string $color3 Optional. Color 3 of the icon. |
| 216 |
* @return string The svg resource as a base64. |
| 217 |
* @since 3.1.0 |
| 218 |
*/ |
| 219 |
private static function get_base64_w3tc_icon( $color1 = '#3b7e83', $color2 = '#3b7e83', $color3 = '#3b7e83' ) { |
| 220 |
$source = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" fill-rule="evenodd" fill="none" width="100" height="100" viewBox="0 0 100 100">'; |
| 221 |
$source .= '<g transform="scale(6.4,6.4) translate(0,0)">'; |
| 222 |
$source .= '<path fill="' . $color1 . '" d="M10.39 6.69C10.79 6.9 11.26 6.9 11.67 6.7C12.35 6.36 13.75 5.68 14.43 5.34C14.71 5.2 14.71 4.8 14.43 4.65C13.12 3.96 9.87 2.25 8.56 1.57C8.11 1.33 7.57 1.3 7.09 1.49C6.33 1.8 4.85 2.4 4.11 2.7C3.78 2.84 3.76 3.29 4.07 3.46C5.46 4.17 8.97 5.96 10.39 6.69Z"/>'; |
| 223 |
$source .= '<path fill="' . $color2 . '" d="M9.02 14.58C8.7 14.76 8.33 14.45 8.46 14.11C8.97 12.77 10.26 9.32 10.81 7.87C10.92 7.57 11.13 7.33 11.41 7.19C12.17 6.8 13.89 5.92 14.62 5.54C14.83 5.44 15.06 5.64 14.99 5.86C14.55 7.17 13.45 10.49 13.02 11.79C12.89 12.19 12.62 12.53 12.25 12.73C11.42 13.21 9.78 14.15 9.02 14.58Z"/>'; |
| 224 |
$source .= '<path fill="' . $color3 . '" d="M3.95 3.7L10.24 6.91L10.39 7.01L10.5 7.13L10.58 7.28L10.62 7.45L10.62 7.62L10.58 7.79L8.23 14.02L8.14 14.18L8.02 14.3L7.87 14.37L7.7 14.41L7.53 14.39L7.36 14.33L1.64 10.97L1.39 10.78L1.2 10.55L1.07 10.28L1 9.99L1 9.68L1.07 9.38L3.04 4.06L3.13 3.89L3.26 3.76L3.42 3.67L3.59 3.63L3.77 3.64L3.95 3.7ZM3.76 9.39L4.66 8.34L4.66 9.93L5.06 10.11L6.23 8.91L7.38 9.51L6.79 9.86L6.91 10.05L6.98 10.2L7.02 10.33L7.01 10.42L6.95 10.49L6.84 10.53L6.74 10.51L6.62 10.43L6.48 10.29L6.3 10.11L6.15 10.11L6.01 10.1L5.89 10.1L5.79 10.11L5.7 10.11L6.1 10.65L6.47 11.04L6.82 11.27L7.15 11.35L7.45 11.28L7.76 11.03L7.88 10.74L7.86 10.47L7.75 10.24L7.61 10.11L7.7 10.04L7.82 9.94L7.97 9.82L8.17 9.68L8.39 9.51L6.18 8.19L5.22 9.16L5.13 7.66L4.73 7.44L3.9 8.42L3.9 6.9L3.28 6.58L3.28 9.09L3.76 9.39Z"/>'; |
| 225 |
$source .= '</g>'; |
| 226 |
$source .= '</svg>'; |
| 227 |
// phpcs:ignore |
| 228 |
return 'data:image/svg+xml;base64,' . base64_encode( $source ); |
| 229 |
} |
| 230 |
|
| 231 |
/** |
| 232 |
* Returns a base64 svg resource for the Amelia Stripe Gateway icon. |
| 233 |
* |
| 234 |
* @param string $color1 Optional. Color 1 of the icon. |
| 235 |
* @param string $color2 Optional. Color 2 of the icon. |
| 236 |
* @return string The svg resource as a base64. |
| 237 |
* @since 3.1.0 |
| 238 |
*/ |
| 239 |
private static function get_base64_wpcli_icon( $color1 = '#000000', $color2 = '#FFFFFF' ) { |
| 240 |
$source = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" fill-rule="evenodd" fill="none" width="100%" height="100%" viewBox="0 0 500 500">'; |
| 241 |
$source .= '<g transform="matrix(1,0,0,-1,0,463)">'; |
| 242 |
$source .= '<g transform="matrix(1,0,0,1,21.7397,91.0915)"><path d="M65.574,240.252L263.708,240.252C284.134,240.252 347.593,241.91 363.335,239.132C404.38,231.889 446.171,210.26 446.171,163.013C446.171,152.269 444.876,141.099 439.678,131.446C430.726,114.82 420.732,102.895 404.902,92.341C402.492,90.735 399.865,89.54 397.663,85.774C410.174,82.646 457.067,88.222 462.887,83.461C464.735,81.949 465.563,79.697 465.424,77.341C465.085,71.57 451.861,29.429 449.38,19.506C448.465,15.846 445.822,3.146 442.29,1.968C436.848,0.154 354.963,1.446 342.066,1.446L159.23,1.446C144.78,1.446 85.905,-0.232 76.395,2.938C73.361,3.95 69.853,6.041 67.813,8.535C61.869,15.8 53.225,30.829 48.633,39.356C40.844,53.822 3.596,108.997 1.768,119.356C0.398,127.115 1.395,135.746 1.395,143.61C1.395,149.146 0.064,166.192 2.29,170.326C6.384,177.929 45.043,167.848 49.753,176.595C52.364,181.445 46.47,212.47 47.962,220.923C49.334,228.701 55.966,237.377 65.574,240.252ZM73.036,222.341C70.448,220.301 69.705,218.761 69.454,217.341C68.632,212.681 71.495,183.604 72.216,177.117C72.46,174.918 72.174,172.683 72.29,170.476C73.024,156.533 74.541,142.63 75.275,128.685C75.538,123.698 76.505,118.746 76.768,113.759C77.606,97.829 78.914,81.928 79.753,65.998C79.884,63.506 80.499,61.034 80.499,58.535C80.499,53.695 82.132,26.623 83.26,23.237C83.79,21.648 85.115,20.479 86.693,19.953C92.438,18.038 100.247,19.356 106.245,19.356C111.444,19.356 122.517,17.957 126.917,20.326C131.41,22.746 156.14,81.741 161.245,91.222C163.201,94.853 171.638,116.134 175.275,117.117L175.275,67.491C175.275,60.909 173.93,24.939 176.544,21.744C179.773,17.797 193.126,19.356 198.036,19.356C203.236,19.356 212.594,17.415 216.32,21.968C221.154,27.877 267.188,118.464 275.424,133.759C278.428,139.337 296.372,175.326 298.186,175.326C299.769,175.326 299.154,173.08 298.932,172.192C296.171,161.149 293.424,149.549 289.827,138.759C285.089,124.543 282.924,109.394 278.186,95.177C273.164,80.112 269.357,64.339 265.499,48.909C263.996,42.896 255.331,22.596 263.484,19.879C268.988,18.044 276.608,19.356 282.365,19.356C288.156,19.356 303.531,18.01 308.111,20.476C310.209,21.606 311.705,23.419 312.813,25.476C316.366,32.074 327.525,83.508 330.723,87.416C331.344,88.175 332.333,88.446 333.26,88.61C344.405,90.577 355.636,90.496 366.544,94.132C397.55,104.468 424.826,121.166 430.947,155.849C432.661,165.564 430.485,175.94 425.872,184.506C412.268,209.77 379.716,220.91 352.514,222.341C337.93,223.109 323.092,222.341 308.484,222.341C301.612,222.341 262.988,223.72 259.753,221.073C255.046,217.222 225.841,145.376 217.813,137.267L217.813,204.804C217.813,209.608 219.354,217.315 215.126,220.774C212.247,223.13 180.096,222.995 175.126,222.117C173.445,221.821 171.956,220.98 170.872,219.655C167.082,215.022 147.716,169.508 142.29,159.431C140.254,155.649 134.343,138.597 129.753,137.267L129.753,199.58C129.753,204.749 131.431,217.61 127.29,220.998C123.842,223.82 81.944,222.341 73.036,222.341ZM27.514,158.162C18.037,152.678 31.602,143.332 32.514,138.162C33.709,131.389 22.372,125.994 23.559,120.849C24.345,117.442 28.885,115.628 31.618,117.864C34.182,119.961 45.014,134.165 45.201,136.968C45.443,140.602 32.427,156.452 27.514,158.162ZM362.589,67.117C333.256,59.601 331.101,9.98 363.708,20.849C366.938,21.925 381.492,29.569 373.036,31.52C369.657,32.3 346.381,16.263 347.663,40.625C348.174,50.338 357.385,61.297 367.962,59.431C371.054,58.885 376.714,54.068 379.23,55.326C387.581,59.502 377.681,67.117 362.589,67.117ZM397.663,66.371C393.782,60.102 384.731,31.271 383.708,25.476C383.48,24.184 383.589,22.503 384.454,21.446C386.328,19.155 395.813,20.103 398.783,20.103C402.833,20.103 414.111,18.086 414.529,24.356C414.879,29.615 407.32,28.311 404.007,28.311L394.678,28.311L393.932,29.058C393.932,37.769 404.21,59.187 402.365,63.983C401.751,65.578 400.486,65.706 397.663,66.371ZM436.469,66.371C432.513,59.951 431.083,53.783 429.678,48.162C428.72,44.331 427.495,40.419 426.245,36.67C425.673,34.953 425.325,33.162 424.753,31.446C424.075,29.412 421.852,24.024 423.335,22.117C424.835,20.189 428.513,20.867 429.902,22.565C430.896,23.78 441.917,60.415 441.917,62.491C441.917,64.585 440.052,66.371 436.469,66.371Z" style="fill:' . $color1 . '"/></g>'; |
| 243 |
$source .= '<g transform="matrix(1,0,0,1,443.575,111.041)"><path d="M14.634,46.422C18.217,46.422 20.082,44.635 20.082,42.541C20.082,40.466 9.061,3.831 8.067,2.616C6.678,0.918 3,0.239 1.5,2.168C0.017,4.075 2.24,9.463 2.918,11.497C3.49,13.213 3.838,15.004 4.41,16.72C5.66,20.47 6.885,24.381 7.843,28.213C9.248,33.833 10.678,40.002 14.634,46.422Z" style="fill:' . $color2 . '"/></g>'; |
| 244 |
$source .= '<g transform="matrix(1,0,0,1,44.2112,206.97)"><path d="M5.043,42.284C9.955,40.574 22.971,24.724 22.729,21.09C22.542,18.287 11.711,4.083 9.147,1.985C6.414,-0.251 1.873,1.564 1.087,4.971C-0.1,10.115 11.238,15.511 10.043,22.284C9.13,27.454 -4.434,36.799 5.043,42.284Z" style="fill:' . $color2 . '"/></g>'; |
| 245 |
$source .= '<g transform="matrix(1,0,0,1,360.659,109.391)"><path d="M23.669,48.818C38.762,48.818 48.662,41.202 40.311,37.027C37.795,35.769 32.134,40.586 29.042,41.131C18.466,42.998 9.255,32.039 8.744,22.325C7.462,-2.036 30.737,14.001 34.117,13.221C42.573,11.269 28.019,3.626 24.789,2.549C-7.818,-8.32 -5.664,41.301 23.669,48.818Z" style="fill:' . $color2 . '"/></g>'; |
| 246 |
$source .= '<g transform="matrix(1,0,0,1,404.345,109.885)"><path d="M15.058,47.578C17.881,46.913 19.146,46.785 19.76,45.19C21.605,40.393 11.327,18.975 11.327,10.264L12.073,9.518L21.402,9.518C24.715,9.518 32.275,10.821 31.924,5.563C31.506,-0.708 20.228,1.309 16.178,1.309C13.208,1.309 3.724,0.362 1.849,2.652C0.984,3.71 0.875,5.39 1.103,6.682C2.126,12.477 11.177,41.308 15.058,47.578Z" style="fill:' . $color2 . '"/></g>'; |
| 247 |
$source .= '<g transform="matrix(1,0,0,1,361.114,224.723)"><path d="M12.767,43.933C19.009,43.933 23.976,43.127 28.364,41.247C50.92,31.58 42.344,9.257 18.065,3.187C14.953,2.409 3.267,-0.845 1.498,2.441C-0.669,6.465 4.865,20.906 6.05,25.65C7.486,31.391 8.764,37.42 12.767,43.933Z" style="fill:' . $color1 . '"/></g>'; |
| 248 |
$source .= '<g transform="matrix(1,0,0,1,90.047,108.993)"><path d="M4.729,204.44C13.637,204.44 55.534,205.918 58.983,203.096C63.124,199.708 61.446,186.848 61.446,181.678L61.446,119.365C66.035,120.695 71.947,137.748 73.983,141.529C79.409,151.607 98.775,197.121 102.565,201.753C103.649,203.078 105.138,203.919 106.819,204.216C111.789,205.093 143.939,205.228 146.819,202.872C151.047,199.413 149.505,191.706 149.505,186.902L149.505,119.365C157.534,127.475 186.739,199.32 191.446,203.171C194.681,205.818 233.305,204.44 240.177,204.44C254.784,204.44 269.622,205.207 284.207,204.44C311.409,203.008 343.961,191.868 357.565,166.604C362.177,158.038 364.354,147.662 362.64,137.947C356.519,103.264 329.243,86.566 298.237,76.231C287.328,72.595 276.097,72.675 264.953,70.708C264.026,70.545 263.036,70.273 262.416,69.514C259.218,65.606 248.058,14.173 244.505,7.574C243.398,5.517 241.902,3.704 239.804,2.574C235.224,0.108 219.848,1.455 214.057,1.455C208.3,1.455 200.68,0.142 195.177,1.977C187.024,4.694 195.689,24.994 197.192,31.007C201.049,46.437 204.857,62.21 209.878,77.275C214.617,91.492 216.781,106.641 221.52,120.858C225.117,131.647 227.864,143.248 230.625,154.29C230.847,155.178 231.462,157.425 229.878,157.425C228.065,157.425 210.121,121.436 207.117,115.857C198.881,100.562 152.847,9.975 148.013,4.066C144.287,-0.487 134.929,1.455 129.729,1.455C124.819,1.455 111.466,-0.104 108.237,3.843C105.623,7.038 106.968,43.007 106.968,49.589L106.968,99.216C103.331,98.232 94.893,76.952 92.938,73.32C87.833,63.84 63.103,4.844 58.61,2.425C54.209,0.055 43.137,1.455 37.938,1.455C31.94,1.455 24.13,0.137 18.386,2.052C16.808,2.577 15.483,3.747 14.953,5.335C13.824,8.721 12.192,35.793 12.192,40.634C12.192,43.132 11.577,45.604 11.446,48.096C10.607,64.027 9.299,79.927 8.46,95.858C8.198,100.845 7.23,105.796 6.968,110.783C6.234,124.728 4.717,138.631 3.983,152.574C3.867,154.781 4.153,157.017 3.908,159.216C3.188,165.702 0.325,194.78 1.147,199.44C1.398,200.86 2.141,202.399 4.729,204.44ZM283.834,159.663C279.831,153.15 278.553,147.121 277.117,141.38C275.931,136.636 270.398,122.196 272.565,118.171C274.334,114.885 286.02,118.139 289.132,118.917C313.411,124.987 321.987,147.31 299.431,156.977C295.042,158.858 290.076,159.663 283.834,159.663Z" style="fill:' . $color2 . '"/></g>'; |
| 249 |
$source .= '</g>'; |
| 250 |
$source .= '</svg>'; |
| 251 |
// phpcs:ignore |
| 252 |
return 'data:image/svg+xml;base64,' . base64_encode( $source ); |
| 253 |
} |
| 254 |
|
| 255 |
/** |
| 256 |
* Returns a base64 svg resource for the Cavalcade icon. |
| 257 |
* |
| 258 |
* @param string $color Optional. Color of the icon. |
| 259 |
* @return string The svg resource as a base64. |
| 260 |
* @since 3.1.0 |
| 261 |
*/ |
| 262 |
private static function get_base64_cavalcade_icon( $color = '#C1503B' ) { |
| 263 |
$source = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 480" preserveAspectRatio="xMidYMid meet">'; |
| 264 |
$source .= '<defs><clipPath id="a"><path d="M0 2406.94V0h4106.71v2406.94z"/></clipPath></defs>'; |
| 265 |
$source .= '<g clip-path="url(#a)" transform="scale(0.15,-0.15) translate(0,-3200)">'; |
| 266 |
$source .= '<path d="M399.133 272.191c-77.379 0-133.321 68.457-133.321 208.329 0 236.82 193.567 438.269 399.286 553.95-13.536-146.482-33.903-304.072-48.305-400.892-26.637-179.039-89.684-361.387-217.66-361.387zM4043.11 673.539c-45.31-25.68-93.5-41.5-143.94-41.5-114.67 0-180.79 57.723-208.23 151.09-55.66 189.371-3.75 532.581 15.39 757.111 25.88 303.7 38.23 422.92 43.17 486.45 11.58 148.25-46.35 313.24-214.98 312.08-156.74-1.09-361.16-189.03-451.47-378.17 22.01 242.25-47.85 447.62-232.36 446.33-184.51-1.26-373.5-275.42-431.17-393.38 11.68 110.21 18.04 156.43 23.08 215.99 5.02 59.56 3.01 102.64-59.26 108.73-37.75 3.7-111.42-9.32-153.98-16.55-54.51-9.27-72.19-48.17-82.25-132.52-7.24-60.9-26.28-302.26-45.11-534.81-42.76-3.43-112.77-16.97-154.67-22.81-78.71-10.97-129-19.66-205.93-33.34 25.97 271.86 64.04 562.01 77.18 668.41 7.95 64.36 1.8 104.76-64.88 112.68-37.89 4.49-152.66-11.97-188.36-17.83-58.73-9.63-81.1-59.68-88.54-98.7-30.08-157.71-58.72-442.92-77.96-731.99-125.97-30.83-250.6-66.36-374.78-107.33 12.36 224.59 20.49 475.12 12.76 598.7-11.14 178.23-113.093 295.23-269.84 295.23-166.992 0-359.718-89.76-480.652-191.95-79.078-66.81-123.558-144.16-123.558-205.37 0-62.49 31.296-119.08 113.953-119.08 63.957 87.44 231.336 240.85 324.804 240.85 84.102 0 105.563-73 105.563-147.41 0-61.2-12.348-343.84-24.32-582.72C362.012 1168.4 0 895.09 0 467.52 0 190.73 168.969 9.07 411.109 9.07c316.782 0 482.852 286.942 534.715 600.59 26.563 160.711 46.969 369.231 60.886 549.67 1.43.48 2.88.98 4.33 1.46 123.1 40.88 247.46 78.78 372.92 112.55-18.97-362.481-28.78-690.981 68.3-929.121 82.01-201.18 256-346.25 528.7-344.2 187.5 1.403 362.25 76.7 440.51 147.559 26.09 23.621 36.89 56.293 36.03 78.594-1.77 46.09-30.99 83.668-69.7 109.019-77.52-44.089-163.44-81.25-285.35-85.921-121.93-4.668-287.58 61.832-355.64 284.582-58.73 192.128-41.64 570.618-25.61 813.798 118.2 23.4 237.29 46.97 357.14 59.93l3.75 5.72c-1.5-17.65-2.96-34.72-4.39-51.04-23.57-270.02-54.71-688.94-53.42-772.26 1-63.488 33.15-89.078 80.76-88.738 47.62.316 132.68 16.859 162.29 26.988 24.28 8.32 43.67 19.379 56.91 40.082 11.94 18.707 18.26 46.727 20.51 83.477 6.08 99.281 22.42 343.441 37.85 498.311 15.45 154.88 30.76 289.72 58.69 409.19 56.25 240.57 171.74 501.21 276.9 501.94 67.46.46 69.65-126.57 50.56-301.32-19.1-174.76-70.62-814.071-69.43-891.442 1.06-67.457 20.98-103.047 78.99-102.636 47.61.32 137.55 7.089 173.06 21.238 22.35 8.89 38.93 17.148 50.37 37.129 10.06 17.582 16.14 44.222 18.62 88.34 5.68 101.471 42.56 511.011 74.8 640.461 61.51 246.86 190.2 411.94 261.62 412.43 71.43.49 49.2-175.27 30.51-375.85-36.11-387.21-72.97-791.209 23.96-988.791 57.33-116.879 160.53-226.571 405.28-226.571 91.7 0 197.22 36.883 253.65 92.391 25.53 25.121 37.54 69.051 36.47 92.152-2.17 47.731-24.22 88.481-63.54 114.758" fill="' . $color . '"/>'; |
| 267 |
$source .= '</g>'; |
| 268 |
$source .= '</svg>'; |
| 269 |
// phpcs:ignore |
| 270 |
return 'data:image/svg+xml;base64,' . base64_encode( $source ); |
| 271 |
} |
| 272 |
|
| 273 |
/** |
| 274 |
* Returns a base64 svg resource for the MariaDB icon. |
| 275 |
* |
| 276 |
* @param string $color Optional. Color of the icon. |
| 277 |
* @return string The svg resource as a base64. |
| 278 |
* @since 3.1.0 |
| 279 |
*/ |
| 280 |
private static function get_base64_db_mariadb_icon( $color = '#003545' ) { |
| 281 |
$source = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000" preserveAspectRatio="xMidYMid meet">'; |
| 282 |
$source .= '<g transform="scale(3.2,3.2) translate(0,60)">'; |
| 283 |
$source .= '<path d="M299.2,4.34a4.35,4.35,0,0,0-2.92-1c-2.9,0-6.65,2-8.66,3-.35.19-.62.33-.81.41A27.32,27.32,0,0,1,276,9.53c-3.86.12-7.19.35-11.5.8C238.82,13,227.43,32.6,216.42,51.6c-6,10.32-12.18,21-20.67,29.28a54.92,54.92,0,0,1-5.59,4.74c-8.78,6.54-19.81,11.17-28.43,14.47-8.26,3.15-17.28,6-26,8.74-8,2.51-15.51,4.89-22.44,7.46-3.13,1.16-5.79,2-8.13,2.83-6.31,2.1-10.87,3.62-17.51,8.17-2.59,1.77-5.19,3.69-7,5.14A73.46,73.46,0,0,0,66.8,147.05a86.62,86.62,0,0,1-11.6,14c-1.4,1.37-3.89,2-7.62,2-4.37,0-9.67-.9-15.28-1.85-5.77-1-11.75-2-16.87-2-4.17,0-7.35.67-9.74,2.06,0,0-4,2.34-5.69,5.36l1.66.75a34.71,34.71,0,0,1,7.1,5.07,35.39,35.39,0,0,0,7.37,5.25,6.61,6.61,0,0,1,2.27,1.51c-.7,1-1.73,2.35-2.8,3.76-5.92,7.74-9.37,12.63-7.39,15.29a6.09,6.09,0,0,0,3,.71c12.9,0,19.82-3.36,28.59-7.6,2.54-1.23,5.16-2.5,8.16-3.8,5.12-2.22,10.64-5.76,16.48-9.52,7.74-5,15.74-10.11,23.49-12.6a64,64,0,0,1,19.71-2.77c8.23,0,16.83,1.1,25.15,2.17,6.21.79,12.63,1.61,18.93,2,2.45.15,4.72.22,6.92.22a77.2,77.2,0,0,0,8.83-.47l.7-.24c4.42-2.72,6.49-8.55,8.5-14.18,1.29-3.63,2.37-6.89,4.05-9a2.79,2.79,0,0,1,.34-.28.4.4,0,0,1,.5.09s0,.05,0,.15c-1.06,22.06-9.9,36.05-18.88,48.49l-6,6.43s8.39,0,13.16-1.84c17.42-5.21,30.58-16.69,40.15-35a149.42,149.42,0,0,0,6.32-14.44c.16-.41,1.68-1.17,1.53.95,0,.63-.09,1.32-.14,2h0c0,.43-.06.87-.08,1.31-.25,3-1,9.57-1,9.57l5.38-2.88c13-8.22,23-24.74,30.56-50.47,3.16-10.72,5.47-21.37,7.51-30.76,2.44-11.23,4.55-20.93,7-24.68,3.78-5.89,9.55-9.87,15.13-13.73l2.28-1.58c7-4.93,14-10.62,15.54-21.22l0-.24C301.22,7.29,300.27,5.27,299.2,4.34Z" transform="translate(0 -3.38)" style="fill:' . $color . '"/>'; |
| 284 |
$source .= '</g>'; |
| 285 |
$source .= '</svg>'; |
| 286 |
// phpcs:ignore |
| 287 |
return 'data:image/svg+xml;base64,' . base64_encode( $source ); |
| 288 |
} |
| 289 |
|
| 290 |
/** |
| 291 |
* Returns a base64 svg resource for the MySql icon. |
| 292 |
* |
| 293 |
* @param string $color Optional. Color of the icon. |
| 294 |
* @return string The svg resource as a base64. |
| 295 |
* @since 3.1.0 |
| 296 |
*/ |
| 297 |
private static function get_base64_db_mysql_icon( $color = '#00678c' ) { |
| 298 |
$source = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000" preserveAspectRatio="xMidYMid meet">'; |
| 299 |
$source .= '<g transform="scale(11,11) translate(-100,-34)">'; |
| 300 |
$source .= '<path d="M179.076 94.886c-3.568-.1-6.336.268-8.656 1.25-.668.27-1.74.27-1.828 1.116.357.355.4.936.713 1.428.535.893 1.473 2.096 2.32 2.72l2.855 2.053c1.74 1.07 3.703 1.695 5.398 2.766.982.625 1.963 1.428 2.945 2.098.5.357.803.938 1.428 1.16v-.135c-.312-.4-.402-.98-.713-1.428l-1.34-1.293c-1.293-1.74-2.9-3.258-4.64-4.506-1.428-.982-4.55-2.32-5.13-3.97l-.088-.1c.98-.1 2.14-.447 3.078-.715 1.518-.4 2.9-.312 4.46-.713l2.143-.625v-.4c-.803-.803-1.383-1.874-2.23-2.632-2.275-1.963-4.775-3.882-7.363-5.488-1.383-.892-3.168-1.473-4.64-2.23-.537-.268-1.428-.402-1.74-.848-.805-.98-1.25-2.275-1.83-3.436l-3.658-7.763c-.803-1.74-1.295-3.48-2.275-5.086-4.596-7.585-9.594-12.18-17.268-16.687-1.65-.937-3.613-1.34-5.7-1.83l-3.346-.18c-.715-.312-1.428-1.16-2.053-1.562-2.543-1.606-9.102-5.086-10.977-.5-1.205 2.9 1.785 5.755 2.8 7.228.76 1.026 1.74 2.186 2.277 3.346.3.758.4 1.562.713 2.365.713 1.963 1.383 4.15 2.32 5.98.5.937 1.025 1.92 1.65 2.767.357.5.982.714 1.115 1.517-.625.893-.668 2.23-1.025 3.347-1.607 5.042-.982 11.288 1.293 15 .715 1.115 2.4 3.57 4.686 2.632 2.008-.803 1.56-3.346 2.14-5.577.135-.535.045-.892.312-1.25v.1l1.83 3.703c1.383 2.186 3.793 4.462 5.8 5.98 1.07.803 1.918 2.187 3.256 2.677v-.135h-.088c-.268-.4-.67-.58-1.027-.892-.803-.803-1.695-1.785-2.32-2.677-1.873-2.498-3.523-5.265-4.996-8.12-.715-1.383-1.34-2.9-1.918-4.283-.27-.536-.27-1.34-.715-1.606-.67.98-1.65 1.83-2.143 3.034-.848 1.918-.936 4.283-1.248 6.737-.18.045-.1 0-.18.1-1.426-.356-1.918-1.83-2.453-3.078-1.338-3.168-1.562-8.254-.402-11.913.312-.937 1.652-3.882 1.117-4.774-.27-.848-1.16-1.338-1.652-2.008-.58-.848-1.203-1.918-1.605-2.855-1.07-2.5-1.605-5.265-2.766-7.764-.537-1.16-1.473-2.365-2.232-3.435-.848-1.205-1.783-2.053-2.453-3.48-.223-.5-.535-1.294-.178-1.83.088-.357.268-.5.623-.58.58-.5 2.232.134 2.812.4 1.65.67 3.033 1.294 4.416 2.23.625.446 1.295 1.294 2.098 1.518h.938c1.428.312 3.033.1 4.37.5 2.365.76 4.506 1.874 6.426 3.08 5.844 3.703 10.664 8.968 13.92 15.26.535 1.026.758 1.963 1.25 3.034.938 2.187 2.098 4.417 3.033 6.56.938 2.097 1.83 4.24 3.168 5.98.67.937 3.346 1.427 4.55 1.918.893.4 2.275.76 3.08 1.25 1.516.937 3.033 2.008 4.46 3.034.713.534 2.945 1.65 3.078 2.54zm-45.5-38.772a7.09 7.09 0 0 0-1.828.223v.1h.088c.357.714.982 1.205 1.428 1.83l1.027 2.142.088-.1c.625-.446.938-1.16.938-2.23-.268-.312-.312-.625-.535-.937-.268-.446-.848-.67-1.206-1.026z" fill-rule="evenodd" fill="' . $color . '"/>'; |
| 301 |
$source .= '</g>'; |
| 302 |
$source .= '</svg>'; |
| 303 |
// phpcs:ignore |
| 304 |
return 'data:image/svg+xml;base64,' . base64_encode( $source ); |
| 305 |
} |
| 306 |
|
| 307 |
/** |
| 308 |
* Returns a base64 svg resource for the postgreSQL icon. |
| 309 |
* |
| 310 |
* @param string $color1 Optional. Color 1 of the icon. |
| 311 |
* @param string $color2 Optional. Color 2 of the icon. |
| 312 |
* @param string $color3 Optional. Color 3 of the icon. |
| 313 |
* @return string The svg resource as a base64. |
| 314 |
* @since 3.1.0 |
| 315 |
*/ |
| 316 |
private static function get_base64_db_postgresql_icon( $color1 = '#000000', $color2 = '#336791', $color3 = '#ffffff' ) { |
| 317 |
$source = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000" preserveAspectRatio="xMidYMid meet">'; |
| 318 |
$source .= '<g transform="scale(2,2) translate(0,0)">'; |
| 319 |
$source .= '<g id="orginal" style="fill-rule:nonzero;clip-rule:nonzero;stroke:' . $color1 . ';stroke-miterlimit:4;"></g>'; |
| 320 |
$source .= '<g id="Layer_x0020_3" style="fill-rule:nonzero;clip-rule:nonzero;fill:none;stroke:' . $color3 . ';stroke-width:12.4651;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;">'; |
| 321 |
$source .= '<path style="fill:' . $color1 . ';stroke:' . $color1 . ';stroke-width:37.3953;stroke-linecap:butt;stroke-linejoin:miter;" d="M323.205,324.227c2.833-23.601,1.984-27.062,19.563-23.239l4.463,0.392c13.517,0.615,31.199-2.174,41.587-7c22.362-10.376,35.622-27.7,13.572-23.148c-50.297,10.376-53.755-6.655-53.755-6.655c53.111-78.803,75.313-178.836,56.149-203.322 C352.514-5.534,262.036,26.049,260.522,26.869l-0.482,0.089c-9.938-2.062-21.06-3.294-33.554-3.496c-22.761-0.374-40.032,5.967-53.133,15.904c0,0-161.408-66.498-153.899,83.628c1.597,31.936,45.777,241.655,98.47,178.31 c19.259-23.163,37.871-42.748,37.871-42.748c9.242,6.14,20.307,9.272,31.912,8.147l0.897-0.765c-0.281,2.876-0.157,5.689,0.359,9.019c-13.572,15.167-9.584,17.83-36.723,23.416c-27.457,5.659-11.326,15.734-0.797,18.367c12.768,3.193,42.305,7.716,62.268-20.224 l-0.795,3.188c5.325,4.26,4.965,30.619,5.72,49.452c0.756,18.834,2.017,36.409,5.856,46.771c3.839,10.36,8.369,37.05,44.036,29.406c29.809-6.388,52.6-15.582,54.677-101.107"/>'; |
| 322 |
$source .= '<path style="fill:' . $color2 . ';stroke:none;" d="M402.395,271.23c-50.302,10.376-53.76-6.655-53.76-6.655c53.111-78.808,75.313-178.843,56.153-203.326c-52.27-66.785-142.752-35.2-144.262-34.38l-0.486,0.087c-9.938-2.063-21.06-3.292-33.56-3.496c-22.761-0.373-40.026,5.967-53.127,15.902 c0,0-161.411-66.495-153.904,83.63c1.597,31.938,45.776,241.657,98.471,178.312c19.26-23.163,37.869-42.748,37.869-42.748c9.243,6.14,20.308,9.272,31.908,8.147l0.901-0.765c-0.28,2.876-0.152,5.689,0.361,9.019c-13.575,15.167-9.586,17.83-36.723,23.416 c-27.459,5.659-11.328,15.734-0.796,18.367c12.768,3.193,42.307,7.716,62.266-20.224l-0.796,3.188c5.319,4.26,9.054,27.711,8.428,48.969c-0.626,21.259-1.044,35.854,3.147,47.254c4.191,11.4,8.368,37.05,44.042,29.406c29.809-6.388,45.256-22.942,47.405-50.555 c1.525-19.631,4.976-16.729,5.194-34.28l2.768-8.309c3.192-26.611,0.507-35.196,18.872-31.203l4.463,0.392c13.517,0.615,31.208-2.174,41.591-7c22.358-10.376,35.618-27.7,13.573-23.148z"/>'; |
| 323 |
$source .= '<path d="M215.866,286.484c-1.385,49.516,0.348,99.377,5.193,111.495c4.848,12.118,15.223,35.688,50.9,28.045c29.806-6.39,40.651-18.756,45.357-46.051c3.466-20.082,10.148-75.854,11.005-87.281"/>'; |
| 324 |
$source .= '<path d="M173.104,38.256c0,0-161.521-66.016-154.012,84.109c1.597,31.938,45.779,241.664,98.473,178.316c19.256-23.166,36.671-41.335,36.671-41.335"/>'; |
| 325 |
$source .= '<path d="M260.349,26.207c-5.591,1.753,89.848-34.889,144.087,34.417c19.159,24.484-3.043,124.519-56.153,203.329"/>'; |
| 326 |
$source .= '<path style="stroke-linejoin:bevel;" d="M348.282,263.953c0,0,3.461,17.036,53.764,6.653c22.04-4.552,8.776,12.774-13.577,23.155c-18.345,8.514-59.474,10.696-60.146-1.069c-1.729-30.355,21.647-21.133,19.96-28.739c-1.525-6.85-11.979-13.573-18.894-30.338 c-6.037-14.633-82.796-126.849,21.287-110.183c3.813-0.789-27.146-99.002-124.553-100.599c-97.385-1.597-94.19,119.762-94.19,119.762"/>'; |
| 327 |
$source .= '<path d="M188.604,274.334c-13.577,15.166-9.584,17.829-36.723,23.417c-27.459,5.66-11.326,15.733-0.797,18.365c12.768,3.195,42.307,7.718,62.266-20.229c6.078-8.509-0.036-22.086-8.385-25.547c-4.034-1.671-9.428-3.765-16.361,3.994z"/>'; |
| 328 |
$source .= '<path d="M187.715,274.069c-1.368-8.917,2.93-19.528,7.536-31.942c6.922-18.626,22.893-37.255,10.117-96.339c-9.523-44.029-73.396-9.163-73.436-3.193c-0.039,5.968,2.889,30.26-1.067,58.548c-5.162,36.913,23.488,68.132,56.479,64.938"/>'; |
| 329 |
$source .= '<path style="fill:' . $color3 . ';stroke-width:4.155;stroke-linecap:butt;stroke-linejoin:miter;" d="M172.517,141.7c-0.288,2.039,3.733,7.48,8.976,8.207c5.234,0.73,9.714-3.522,9.998-5.559c0.284-2.039-3.732-4.285-8.977-5.015c-5.237-0.731-9.719,0.333-9.996,2.367z"/>'; |
| 330 |
$source .= '<path style="fill:' . $color3 . ';stroke-width:2.0775;stroke-linecap:butt;stroke-linejoin:miter;" d="M331.941,137.543c0.284,2.039-3.732,7.48-8.976,8.207c-5.238,0.73-9.718-3.522-10.005-5.559c-0.277-2.039,3.74-4.285,8.979-5.015c5.239-0.73,9.718,0.333,10.002,2.368z"/>'; |
| 331 |
$source .= '<path d="M350.676,123.432c0.863,15.994-3.445,26.888-3.988,43.914c-0.804,24.748,11.799,53.074-7.191,81.435"/>'; |
| 332 |
$source .= '<path style="stroke-width:3;" d="M0,60.232"/>'; |
| 333 |
$source .= '</g>'; |
| 334 |
$source .= '</g>'; |
| 335 |
$source .= '</svg>'; |
| 336 |
// phpcs:ignore |
| 337 |
return 'data:image/svg+xml;base64,' . base64_encode( $source ); |
| 338 |
} |
| 339 |
|
| 340 |
/** |
| 341 |
* Returns a base64 svg resource for the postgreSQL icon. |
| 342 |
* |
| 343 |
* @param string $color1 Optional. Color 1 of the icon. |
| 344 |
* @param string $color2 Optional. Color 2 of the icon. |
| 345 |
* @param string $color3 Optional. Color 3 of the icon. |
| 346 |
* @param string $color4 Optional. Color 4 of the icon. |
| 347 |
* @return string The svg resource as a base64. |
| 348 |
* @since 3.1.0 |
| 349 |
*/ |
| 350 |
private static function get_base64_db_percona_icon( $color1 = '#FBB32F', $color2 = '#C11511', $color3 = '#C11411', $color4 = '#FCB42F' ) { |
| 351 |
$source = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000" preserveAspectRatio="xMidYMid meet">'; |
| 352 |
$source .= '<g transform="scale(3.4,3.4) translate(30,0)">'; |
| 353 |
$source .= '<defs><linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="a"><stop stop-color="' . $color1 . '" offset="0%"/><stop stop-color="' . $color2 . '" offset="50.474%"/><stop stop-color="' . $color3 . '" offset="100%"/></linearGradient></defs>'; |
| 354 |
$source .= '<path d="M128 .578C57.308.578 0 56.413 0 125.29c0 43.086 22.427 81.066 56.526 103.47V125.354c-.001-.158-.023-.31-.023-.467 0-.158.022-.31.023-.468v-.877h.043c.701-40.146 32.335-72.48 71.323-72.48 39.427 0 71.388 33.052 71.388 73.825 0 40.772-31.961 73.825-71.388 73.825-15.356 0-29.543-5.062-41.187-13.592v58.207A130.796 130.796 0 0 0 128 250c70.692 0 128-55.835 128-124.71C256 56.412 198.692.577 128 .577" fill="url(#a)"/>'; |
| 355 |
$source .= '<path d="M171.197 127.472c0 23.59-19.123 42.713-42.713 42.713S85.77 151.062 85.77 127.472s19.124-42.713 42.714-42.713 42.713 19.123 42.713 42.713" fill="' . $color4 . '"/>'; |
| 356 |
$source .= '</g>'; |
| 357 |
$source .= '</svg>'; |
| 358 |
// phpcs:ignore |
| 359 |
return 'data:image/svg+xml;base64,' . base64_encode( $source ); |
| 360 |
} |
| 361 |
|
| 362 |
/** |
| 363 |
* Returns a base64 svg resource for the MySql icon. |
| 364 |
* |
| 365 |
* @param string $color Optional. Color of the icon. |
| 366 |
* @return string The svg resource as a base64. |
| 367 |
* @since 3.1.0 |
| 368 |
*/ |
| 369 |
private static function get_base64_redisocp_icon( $color = '#C93A31' ) { |
| 370 |
$source = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50" preserveAspectRatio="xMidYMid meet">'; |
| 371 |
$source .= '<g transform="scale(0.92,0.92) translate(2,2)">'; |
| 372 |
$source .= '<path d="M25 1a6.465 6.465 0 00-4.578 1.896L2.896 20.422a6.462 6.462 0 00-1.894 4.576c0 1.654.634 3.319 1.894 4.578l17.528 17.528A6.462 6.462 0 0025 48.998a6.463 6.463 0 004.576-1.894l11.73-11.729 5.798-5.797a6.464 6.464 0 001.894-4.537v-.002a6.464 6.464 0 00-1.894-4.617L29.578 2.896A6.47 6.47 0 0025 1zm0 2c1.147 0 2.287.432 3.166 1.31l5.092 5.094-8.254 8.258-8.26-8.258 5.094-5.093A4.443 4.443 0 0125 3zm-9.67 7.818l8.26 8.258L9.41 33.262l-5.1-5.1a4.448 4.448 0 01-1.308-3.164c0-1.146.43-2.284 1.309-3.162l11.02-11.018zm19.342 0l8.152 8.153-8.306 8.203-8.1-8.098 8.254-8.258zm9.566 9.567l1.451 1.45A4.449 4.449 0 0147 25.028h-.002a4.445 4.445 0 01-1.309 3.137l-5.09 5.09-4.667-4.668 8.306-8.201zm-19.234.105l14.182 14.178-11.024 11.021A4.443 4.443 0 0125 46.998a4.443 4.443 0 01-3.162-1.309L10.824 34.676l14.18-14.186z" stroke="' . $color . '"/>'; |
| 373 |
$source .= '</g>'; |
| 374 |
$source .= '</svg>'; |
| 375 |
// phpcs:ignore |
| 376 |
return 'data:image/svg+xml;base64,' . base64_encode( $source ); |
| 377 |
} |
| 378 |
|
| 379 |
/** |
| 380 |
* Returns a base64 svg resource for the postgreSQL icon. |
| 381 |
* |
| 382 |
* @param string $color1 Optional. Color 1 of the icon. |
| 383 |
* @param string $color2 Optional. Color 2 of the icon. |
| 384 |
* @param string $color3 Optional. Color 3 of the icon. |
| 385 |
* @param string $color4 Optional. Color 4 of the icon. |
| 386 |
* @param string $color5 Optional. Color 5 of the icon. |
| 387 |
* @return string The svg resource as a base64. |
| 388 |
* @since 3.1.0 |
| 389 |
*/ |
| 390 |
private static function get_base64_redisoc_icon( $color1 = '#912626', $color2 = '#C6302B', $color3 = '#621B1C', $color4 = '#9A2928', $color5 = '#ffffff' ) { |
| 391 |
$source = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500" preserveAspectRatio="xMidYMid meet">'; |
| 392 |
$source .= '<g transform="scale(1.6,1.6) translate(30,30)">'; |
| 393 |
$source .= '<path fill="' . $color1 . '" d="M245.97 168.943c-13.662 7.121-84.434 36.22-99.501 44.075-15.067 7.856-23.437 7.78-35.34 2.09-11.902-5.69-87.216-36.112-100.783-42.597C3.566 169.271 0 166.535 0 163.951v-25.876s98.05-21.345 113.879-27.024c15.828-5.679 21.32-5.884 34.79-.95 13.472 4.936 94.018 19.468 107.331 24.344l-.006 25.51c.002 2.558-3.07 5.364-10.024 8.988"/>'; |
| 394 |
$source .= '<path fill="' . $color2 . '" d="M245.965 143.22c-13.661 7.118-84.431 36.218-99.498 44.072-15.066 7.857-23.436 7.78-35.338 2.09-11.903-5.686-87.214-36.113-100.78-42.594-13.566-6.485-13.85-10.948-.524-16.166 13.326-5.22 88.224-34.605 104.055-40.284 15.828-5.677 21.319-5.884 34.789-.948 13.471 4.934 83.819 32.935 97.13 37.81 13.316 4.881 13.827 8.9.166 16.02"/>'; |
| 395 |
$source .= '<path fill="' . $color1 . '" d="M245.97 127.074c-13.662 7.122-84.434 36.22-99.501 44.078-15.067 7.853-23.437 7.777-35.34 2.087-11.903-5.687-87.216-36.112-100.783-42.597C3.566 127.402 0 124.67 0 122.085V96.206s98.05-21.344 113.879-27.023c15.828-5.679 21.32-5.885 34.79-.95C162.142 73.168 242.688 87.697 256 92.574l-.006 25.513c.002 2.557-3.07 5.363-10.024 8.987"/>'; |
| 396 |
$source .= '<path fill="' . $color2 . '" d="M245.965 101.351c-13.661 7.12-84.431 36.218-99.498 44.075-15.066 7.854-23.436 7.777-35.338 2.087-11.903-5.686-87.214-36.112-100.78-42.594-13.566-6.483-13.85-10.947-.524-16.167C23.151 83.535 98.05 54.148 113.88 48.47c15.828-5.678 21.319-5.884 34.789-.949 13.471 4.934 83.819 32.933 97.13 37.81 13.316 4.88 13.827 8.9.166 16.02"/>'; |
| 397 |
$source .= '<path fill="' . $color1 . '" d="M245.97 83.653c-13.662 7.12-84.434 36.22-99.501 44.078-15.067 7.854-23.437 7.777-35.34 2.087-11.903-5.687-87.216-36.113-100.783-42.595C3.566 83.98 0 81.247 0 78.665v-25.88s98.05-21.343 113.879-27.021c15.828-5.68 21.32-5.884 34.79-.95C162.142 29.749 242.688 44.278 256 49.155l-.006 25.512c.002 2.555-3.07 5.361-10.024 8.986"/>'; |
| 398 |
$source .= '<path fill="' . $color2 . '" d="M245.965 57.93c-13.661 7.12-84.431 36.22-99.498 44.074-15.066 7.854-23.436 7.777-35.338 2.09C99.227 98.404 23.915 67.98 10.35 61.497-3.217 55.015-3.5 50.55 9.825 45.331 23.151 40.113 98.05 10.73 113.88 5.05c15.828-5.679 21.319-5.883 34.789-.948 13.471 4.935 83.819 32.934 97.13 37.811 13.316 4.876 13.827 8.897.166 16.017"/>'; |
| 399 |
$source .= '<path fill="' . $color5 . '" d="M159.283 32.757l-22.01 2.285-4.927 11.856-7.958-13.23-25.415-2.284 18.964-6.839-5.69-10.498 17.755 6.944 16.738-5.48-4.524 10.855 17.067 6.391M131.032 90.275L89.955 73.238l58.86-9.035-17.783 26.072M74.082 39.347c17.375 0 31.46 5.46 31.46 12.194 0 6.736-14.085 12.195-31.46 12.195s-31.46-5.46-31.46-12.195c0-6.734 14.085-12.194 31.46-12.194"/>'; |
| 400 |
$source .= '<path fill="' . $color3 . '" d="M185.295 35.998l34.836 13.766-34.806 13.753-.03-27.52"/>'; |
| 401 |
$source .= '<path fill="' . $color4 . '" d="M146.755 51.243l38.54-15.245.03 27.519-3.779 1.478-34.791-13.752"/>'; |
| 402 |
$source .= '</g>'; |
| 403 |
$source .= '</svg>'; |
| 404 |
// phpcs:ignore |
| 405 |
return 'data:image/svg+xml;base64,' . base64_encode( $source ); |
| 406 |
} |
| 407 |
|
| 408 |
/** |
| 409 |
* Returns a base64 svg resource for the WP Migrate icon. |
| 410 |
* |
| 411 |
* @param string $color1 Optional. Color 1 of the icon. |
| 412 |
* @param string $color2 Optional. Color 2 of the icon. |
| 413 |
* @param string $color3 Optional. Color 3 of the icon. |
| 414 |
* @return string The svg resource as a base64. |
| 415 |
* @since 4.1.0 |
| 416 |
*/ |
| 417 |
private static function get_base64_wpmigrate_icon( $color1 = '#81BDD4', $color2 = '#04223F', $color3 = '#ffffff' ) { |
| 418 |
$source = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="52" height="52" viewBox="0 0 52 52">'; |
| 419 |
$source .= '<g fill="none">'; |
| 420 |
$source .= '<path fill="' . $color3 . '" d="M42.867 30.29h-5.531c0-1 .678-1.813 1.516-1.813.018 0 .036.004.054.004.502-.943 1.383-1.571 2.387-1.571.982 0 1.853.607 2.358 1.52a1.727 1.727 0 0 1 1.16-.462c1.075 0 1.942 1.04 1.942 2.322h-3.886ZM30.797 18.066c-1.39-2.155-.705-5.07 1.534-6.514l.387.603c.834-1.86 2.751-3.16 4.983-3.16v10.036h2c.004-1.167 1.127-2.113 2.517-2.113s2.514.946 2.514 2.113h-2.514c-.007 1.177-3.166 2.134-7.063 2.134-3.9 0-7.063-.957-7.063-2.134h3.575a4.452 4.452 0 0 1-.87-.965Zm-6.334 3.99h-6.688c0-.787.82-1.43 1.827-1.43.087 0 .17.011.25.019.487-.408 1.177-.665 1.95-.665 1.469 0 2.66.928 2.66 2.077Zm-8.873-10.064 1.502 1.593c.03-.412.138-.823.34-1.21.805-1.545 2.755-2.123 4.362-1.289l-2.466 4.745h.953c.004-.653.636-1.184 1.416-1.184.787 0 1.419.53 1.419 1.188l-1.42.003c-.01.661-1.787 1.196-3.983 1.196-2.199 0-3.983-.538-3.983-1.203h1.52c-.884-1.127-.765-2.791.34-3.838Zm-6.8 4.724c.16.173.311.357.452.549a4.704 4.704 0 0 1 4.362 3.643 4.696 4.696 0 0 1-1.722 4.774 7.253 7.253 0 0 1 2.484 1.116 8.147 8.147 0 0 1 3.716-1.957 8.142 8.142 0 0 1 5.037.451 4.34 4.34 0 0 1 6.673 3.9 2.51 2.51 0 0 1 2.254 3.084 7.813 7.813 0 0 1 8.515 6.013c.047.21.083.419.116.628a7.137 7.137 0 0 1 3.426 3.347c-.234.26-.48.52-.725.77C38.953 47.544 32.8 50.35 26 50.35 12.574 50.35 1.65 39.426 1.65 26c0-3.756.856-7.316 2.38-10.494.14-.292.289-.574.44-.86a6.451 6.451 0 0 1 3.58 1.38c.288.177.54.408.74.69ZM26 0C16.127 0 6.944 5.753 2.61 14.658A25.753 25.753 0 0 0 0 26c0 14.336 11.664 26 26 26 6.691 0 13.054-2.553 17.918-7.186C49.13 39.849 52 33.168 52 26 52 11.664 40.336 0 26 0Z"></path>'; |
| 421 |
$source .= '<path fill="' . $color3 . '" d="M8.637 31.951c.23-.053.456-.068.685-.093-.23.025-.455.04-.685.093a6.098 6.098 0 0 0-1.821.74v.003a6.012 6.012 0 0 1 1.821-.743m9.325 6.798zM9.206 22.781a7.7 7.7 0 0 0-.172-1.578c-.08-.33-.194-.638-.309-.95.115.312.23.62.305.95.122.531.169 1.058.176 1.578m-3.798-6.627c-.018-.014-.04-.021-.057-.032.018.01.04.018.057.032zm17.572 21.55c.937-.84 2.168-1.464 3.568-1.765a9.251 9.251 0 0 0 0 0c-1.4.301-2.635.925-3.568 1.765a7.434 7.434 0 0 0 0 0M36.293 40.353c.895-.22 1.786.193 2.268.953a4.853 4.853 0 0 1 3.577.883 4.833 4.833 0 0 0-3.574-.883c-.485-.76-1.373-1.172-2.271-.953"></path>'; |
| 422 |
$source .= '<path fill="' . $color1 . '" d="M17.569 28.177h1.61a2.66 2.66 0 0 1 3.04-.018l-.007.018h.974c.015-.555.549-1.004 1.21-1.004.673-.003 1.219.46 1.219 1.026h-1.222l-.004.003h.008c0 .42-.83.781-2.018.942v5.153a3.054 3.054 0 0 1-2.81-1.861l-.215.347c-1.272-.854-1.665-2.584-.873-3.862.004-.003.008-.01.011-.014-.567-.186-.923-.43-.923-.705h.014c-.003-.007-.014-.018-.014-.025M3.586 15.213c.436.157.858.347 1.258.577.018.011.04.018.058.033a7.842 7.842 0 0 1 3.28 3.755c.043.103.065.216.101.318.117.317.233.631.313.967.12.54.167 1.077.175 1.606a7.818 7.818 0 0 1-.451 2.84c-.022.061-.04.12-.066.174a7.867 7.867 0 0 1-3.89 4.227c.426.288.804.646 1.135 1.044.414.5.752 1.069.967 1.711a6.168 6.168 0 0 1 1.847-.752c.232-.054.461-.065.694-.095a6.16 6.16 0 0 1 4.73 1.46c.774.672 1.4 1.53 1.774 2.537.211.128.407.277.585.441.011.011.026.019.037.03.033.029.058.062.087.094.41.413.72.928.89 1.522.019.066.044.128.059.194.01.047.015.095.022.142.025.135.05.27.062.402.112-.059.236-.106.356-.161a6.593 6.593 0 0 1 1.102-.409c.047-.014.087-.033.134-.044.015-.003.03-.003.04-.007a7.836 7.836 0 0 1 1.85-.222c.524 0 1.037.05 1.524.146.97-.854 2.247-1.49 3.701-1.796a9.442 9.442 0 0 1 1.978-.204c1.076 0 2.098.175 3.025.489 1.541.525 2.817 1.441 3.624 2.587.306.438.546.905.702 1.402a2.307 2.307 0 0 1 2.898.81 5.413 5.413 0 0 1 5.013 2.003c.251-.251.495-.514.731-.777a7.175 7.175 0 0 0-3.454-3.383 7.75 7.75 0 0 0-.113-.635c-.905-3.964-4.639-6.544-8.576-6.077.047-.182.073-.376.073-.573a2.534 2.534 0 0 0-2.338-2.544c.004-.072.007-.15.007-.226.011-2.42-1.93-4.394-4.344-4.409a4.298 4.298 0 0 0-2.382.694 8.168 8.168 0 0 0-5.071-.456 8.189 8.189 0 0 0-3.745 1.978 7.24 7.24 0 0 0-2.498-1.128 4.756 4.756 0 0 0 1.734-4.825 4.737 4.737 0 0 0-4.392-3.682 6.072 6.072 0 0 0-.458-.555 2.46 2.46 0 0 0-.741-.697 6.47 6.47 0 0 0-3.603-1.394 24.33 24.33 0 0 0-.444.868m41 12.85a1.87 1.87 0 0 0-1.214.458c-.529-.907-1.44-1.51-2.473-1.51-1.047 0-1.97.624-2.495 1.56-.02 0-.038-.003-.057-.003-.877 0-1.588.807-1.588 1.8h9.862c0-1.273-.908-2.306-2.035-2.306"></path>'; |
| 423 |
$source .= '<path fill="' . $color2 . '" d="M42.746 41.767a5.478 5.478 0 0 0-3.847-.891 2.314 2.314 0 0 0-2.903-.805 5.109 5.109 0 0 0-.704-1.391c-.81-1.138-2.09-2.048-3.636-2.57a9.555 9.555 0 0 0-3.034-.485 9.79 9.79 0 0 0-1.984.203c-1.458.304-2.738.935-3.712 1.783-.489-.094-1-.145-1.528-.145-.646 0-1.27.08-1.856.22-.011.004-.026.004-.04.008-.044.015-.088.033-.135.044-.39.105-.759.242-1.105.405-.12.055-.245.102-.358.16v.004a3.832 3.832 0 0 0-.062-.403c-.007-.047-.01-.094-.022-.137-.014-.07-.04-.13-.058-.196a3.594 3.594 0 0 0-.893-1.515c-.03-.029-.055-.061-.088-.09-.01-.011-.025-.019-.036-.03a3.686 3.686 0 0 0-.587-.438 6.193 6.193 0 0 0-1.78-2.518 6.21 6.21 0 0 0-4.748-1.45c-.23.025-.46.04-.693.094a6.173 6.173 0 0 0-1.852.75v-.003a5.271 5.271 0 0 0-.97-1.7 5.385 5.385 0 0 0-1.138-1.032 7.86 7.86 0 0 0 3.902-4.2l.065-.174c.325-.888.474-1.841.453-2.82a7.498 7.498 0 0 0-.18-1.594c-.076-.333-.192-.645-.31-.96-.036-.102-.057-.214-.101-.316a7.811 7.811 0 0 0-3.29-3.728c-.018-.015-.04-.022-.058-.033a7.91 7.91 0 0 0-1.262-.573 24.168 24.168 0 0 0-2.403 10.531c0 13.473 11.031 24.435 24.59 24.435 6.867 0 13.08-2.816 17.548-7.342a5.567 5.567 0 0 0-1.185-1.098"></path>'; |
| 424 |
$source .= '<path fill="' . $color1 . '" d="M19.648 20.235c-.948 0-1.717.631-1.717 1.417h6.276c0-1.14-1.118-2.062-2.496-2.062-.725 0-1.372.254-1.83.66a1.64 1.64 0 0 0-.233-.015"></path>'; |
| 425 |
$source .= '<path fill="' . $color2 . '" d="M18.15 17.034c2.097 0 3.794-.533 3.805-1.188l1.355-.003c0-.651-.607-1.177-1.355-1.177-.745 0-1.35.526-1.353 1.173h-.91l2.356-4.702c-1.535-.827-3.398-.254-4.167 1.278-.19.383-.297.79-.321 1.198l-1.439-1.578c-1.055 1.038-1.172 2.688-.324 3.804l-1.452.004c0 .658 1.704 1.191 3.805 1.191m16.874 4.483c3.989 0 7.223-.987 7.23-2.201h2.574c0-1.203-1.154-2.179-2.573-2.179-1.424 0-2.573.976-2.577 2.179H37.63l.004-10.35c-2.288 0-4.251 1.34-5.105 3.258l-.396-.622c-2.292 1.49-2.994 4.496-1.571 6.72.248.387.558.707.89.994h-3.659c0 1.214 3.238 2.201 7.23 2.201m-16.166 7.125-.01.015c-.796 1.286-.402 3.027.874 3.887l.215-.349a3.062 3.062 0 0 0 2.819 1.874v-5.188c1.192-.162 2.024-.526 2.024-.948h-.008l.004-.004H26c0-.57-.547-1.036-1.221-1.032-.664 0-1.2.452-1.215 1.01h-.977l.007-.018c-.973-.654-2.176-.607-3.048.018h-1.615c0 .007.011.015.011.026h-.011c0 .275.357.522.926.709"></path>'; |
| 426 |
$source .= '</g>'; |
| 427 |
$source .= '</svg>'; |
| 428 |
// phpcs:ignore |
| 429 |
return 'data:image/svg+xml;base64,' . base64_encode( $source ); |
| 430 |
} |
| 431 |
|
| 432 |
/** |
| 433 |
* Returns a base64 svg resource for the WordPress icon. |
| 434 |
* |
| 435 |
* @return string The svg resource as a base64. |
| 436 |
* @since 3.1.0 |
| 437 |
*/ |
| 438 |
private static function get_base64_blank_icon() { |
| 439 |
$source = '<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" fill-rule="evenodd" fill="none" width="100%" height="100%" viewBox="0 0 100 100">'; |
| 440 |
$source .= '</svg>'; |
| 441 |
// phpcs:ignore |
| 442 |
return 'data:image/svg+xml;base64,' . base64_encode( $source ); |
| 443 |
} |
| 444 |
|
| 445 |
/** |
| 446 |
* Get the (mainly) self-registered icon for a specific component. |
| 447 |
* |
| 448 |
* @param string $component The name of the component. |
| 449 |
* @param boolean $blank Optional. Return a blank icon if not found. |
| 450 |
* @return string The base64 encoded image. |
| 451 |
* @since 3.1.0 |
| 452 |
*/ |
| 453 |
public static function get_icon( $component, $blank = true ) { |
| 454 |
if ( array_key_exists( $component, self::$icons ) ) { |
| 455 |
return self::$icons[ $component ]; |
| 456 |
} |
| 457 |
$result = ''; |
| 458 |
switch ( strtolower( $component ) ) { |
| 459 |
case 'wordpress': |
| 460 |
$result = self::get_base64_wordpress_icon(); |
| 461 |
break; |
| 462 |
case 'w3 total cache': |
| 463 |
$result = self::get_base64_w3tc_icon(); |
| 464 |
break; |
| 465 |
case 'php': |
| 466 |
$result = self::get_base64_php_icon(); |
| 467 |
break; |
| 468 |
case 'jetpack': |
| 469 |
$result = self::get_base64_jetpack_icon(); |
| 470 |
break; |
| 471 |
case 'decalog': |
| 472 |
$result = Core::get_base64_logo(); |
| 473 |
break; |
| 474 |
case 'amelia stripe gateway': |
| 475 |
$result = self::get_base64_amelia_icon(); |
| 476 |
break; |
| 477 |
case 'standard stripe gateway': |
| 478 |
case 'forminator stripe gateway': |
| 479 |
$result = self::get_base64_stripe_icon(); |
| 480 |
break; |
| 481 |
case 'action scheduler': |
| 482 |
case 'woocommerce': |
| 483 |
$result = self::get_base64_woo_icon(); |
| 484 |
break; |
| 485 |
case 'buddypress': |
| 486 |
$result = self::get_base64_buddypress_icon(); |
| 487 |
break; |
| 488 |
case 'bbpress': |
| 489 |
$result = self::get_base64_bbpress_icon(); |
| 490 |
break; |
| 491 |
case 'cavalcade': |
| 492 |
$result = self::get_base64_cavalcade_icon(); |
| 493 |
break; |
| 494 |
case 'wp-cli': |
| 495 |
$result = self::get_base64_wpcli_icon(); |
| 496 |
break; |
| 497 |
case 'mariadb': |
| 498 |
$result = self::get_base64_db_mariadb_icon(); |
| 499 |
break; |
| 500 |
case 'percona': |
| 501 |
$result = self::get_base64_db_percona_icon(); |
| 502 |
break; |
| 503 |
case 'postgresql': |
| 504 |
$result = self::get_base64_db_postgresql_icon(); |
| 505 |
break; |
| 506 |
case 'mysql': |
| 507 |
$result = self::get_base64_db_mysql_icon(); |
| 508 |
break; |
| 509 |
case 'redis object cache': |
| 510 |
$result = self::get_base64_redisoc_icon(); |
| 511 |
break; |
| 512 |
case 'object cache pro': |
| 513 |
$result = self::get_base64_redisocp_icon(); |
| 514 |
break; |
| 515 |
case 'wp migrate': |
| 516 |
case 'wp migrate pro': |
| 517 |
case 'wp migrate lite': |
| 518 |
$result = self::get_base64_wpmigrate_icon(); |
| 519 |
break; |
| 520 |
} |
| 521 |
if ( '' === $result ) { |
| 522 |
foreach ( self::get_selfreg() as $logger ) { |
| 523 |
if ( $logger['name'] === $component ) { |
| 524 |
$result = $logger['icon']; |
| 525 |
} |
| 526 |
} |
| 527 |
} |
| 528 |
if ( '' === $result && $blank ) { |
| 529 |
$result = self::get_base64_blank_icon(); |
| 530 |
} |
| 531 |
self::$icons[ $component ] = $result; |
| 532 |
return $result; |
| 533 |
} |
| 534 |
|
| 535 |
/** |
| 536 |
* Get the self-registered components list for display. |
| 537 |
* |
| 538 |
* @return string The output of the shortcode, ready to print. |
| 539 |
* @since 3.0.0 |
| 540 |
*/ |
| 541 |
public static function sc_get_selfreg() { |
| 542 |
$result = ''; |
| 543 |
foreach ( self::get_selfreg() as $logger ) { |
| 544 |
$result .= '<div style="margin:20px;min-width:200px;">'; |
| 545 |
$result .= '<img style="width:48px;float:left;padding-right:6px;" src="' . ( '' !== $logger['icon'] ? $logger['icon'] : Core::get_base64_logo() ) . '" />'; |
| 546 |
$result .= '<div style="padding-top: 4px"> <span>' . $logger['name'] . '</span><br /><span style="color:silver">' . $logger['version'] . '</span></div>'; |
| 547 |
$result .= '</div>'; |
| 548 |
} |
| 549 |
return '<div style="display:flex;flex-direction:row;flex-wrap:wrap;">' . $result . '</div>'; |
| 550 |
} |
| 551 |
} |
| 552 |
|