Plugin Directory

Changeset 2917889


Ignore:
Timestamp:
05/26/2023 05:53:53 PM (3 years ago)
Author:
iticiti
Message:

Updated code standards.

Location:
custom-site-logo
Files:
82 added
4 edited

Legend:

Unmodified
Added
Removed
  • custom-site-logo/trunk/LICENSE.txt

    r1682917 r2917889  
    1 
    2 GNU GENERAL PUBLIC LICENSE
    3 
    4 Version 2, June 1991
    5 
    6 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
    7 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
    8 
    9 Everyone is permitted to copy and distribute verbatim copies
    10 of this license document, but changing it is not allowed.
    11 Preamble
    12 
    13 The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.
    14 
    15 When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
    16 
    17 To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
    18 
    19 For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
    20 
    21 We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
    22 
    23 Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
    24 
    25 Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
    26 
    27 The precise terms and conditions for copying, distribution and modification follow.
    28 
    29 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
    30 
    31 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
    32 
    33 Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
    34 
    35 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
    36 
    37 You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
    38 
    39 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
    40 
    41 a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
    42 b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
    43 c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
    44 These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
    45 
    46 Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
    47 
    48 In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
    49 
    50 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
    51 
    52 a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
    53 b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
    54 c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
    55 The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
    56 
    57 If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
    58 
    59 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
    60 
    61 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
    62 
    63 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
    64 
    65 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
    66 
    67 If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
    68 
    69 It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
    70 
    71 This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
    72 
    73 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
    74 
    75 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
    76 
    77 Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
    78 
    79 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
    80 
    81 NO WARRANTY
    82 
    83 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
    84 
    85 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
    86 
    87 END OF TERMS AND CONDITIONS
     1                    GNU GENERAL PUBLIC LICENSE
     2                       Version 2, June 1991
     3
     4 Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
     5 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
     6 Everyone is permitted to copy and distribute verbatim copies
     7 of this license document, but changing it is not allowed.
     8
     9                            Preamble
     10
     11  The licenses for most software are designed to take away your
     12freedom to share and change it.  By contrast, the GNU General Public
     13License is intended to guarantee your freedom to share and change free
     14software--to make sure the software is free for all its users.  This
     15General Public License applies to most of the Free Software
     16Foundation's software and to any other program whose authors commit to
     17using it.  (Some other Free Software Foundation software is covered by
     18the GNU Lesser General Public License instead.)  You can apply it to
     19your programs, too.
     20
     21  When we speak of free software, we are referring to freedom, not
     22price.  Our General Public Licenses are designed to make sure that you
     23have the freedom to distribute copies of free software (and charge for
     24this service if you wish), that you receive source code or can get it
     25if you want it, that you can change the software or use pieces of it
     26in new free programs; and that you know you can do these things.
     27
     28  To protect your rights, we need to make restrictions that forbid
     29anyone to deny you these rights or to ask you to surrender the rights.
     30These restrictions translate to certain responsibilities for you if you
     31distribute copies of the software, or if you modify it.
     32
     33  For example, if you distribute copies of such a program, whether
     34gratis or for a fee, you must give the recipients all the rights that
     35you have.  You must make sure that they, too, receive or can get the
     36source code.  And you must show them these terms so they know their
     37rights.
     38
     39  We protect your rights with two steps: (1) copyright the software, and
     40(2) offer you this license which gives you legal permission to copy,
     41distribute and/or modify the software.
     42
     43  Also, for each author's protection and ours, we want to make certain
     44that everyone understands that there is no warranty for this free
     45software.  If the software is modified by someone else and passed on, we
     46want its recipients to know that what they have is not the original, so
     47that any problems introduced by others will not reflect on the original
     48authors' reputations.
     49
     50  Finally, any free program is threatened constantly by software
     51patents.  We wish to avoid the danger that redistributors of a free
     52program will individually obtain patent licenses, in effect making the
     53program proprietary.  To prevent this, we have made it clear that any
     54patent must be licensed for everyone's free use or not licensed at all.
     55
     56  The precise terms and conditions for copying, distribution and
     57modification follow.
     58
     59                    GNU GENERAL PUBLIC LICENSE
     60   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
     61
     62  0. This License applies to any program or other work which contains
     63a notice placed by the copyright holder saying it may be distributed
     64under the terms of this General Public License.  The "Program", below,
     65refers to any such program or work, and a "work based on the Program"
     66means either the Program or any derivative work under copyright law:
     67that is to say, a work containing the Program or a portion of it,
     68either verbatim or with modifications and/or translated into another
     69language.  (Hereinafter, translation is included without limitation in
     70the term "modification".)  Each licensee is addressed as "you".
     71
     72Activities other than copying, distribution and modification are not
     73covered by this License; they are outside its scope.  The act of
     74running the Program is not restricted, and the output from the Program
     75is covered only if its contents constitute a work based on the
     76Program (independent of having been made by running the Program).
     77Whether that is true depends on what the Program does.
     78
     79  1. You may copy and distribute verbatim copies of the Program's
     80source code as you receive it, in any medium, provided that you
     81conspicuously and appropriately publish on each copy an appropriate
     82copyright notice and disclaimer of warranty; keep intact all the
     83notices that refer to this License and to the absence of any warranty;
     84and give any other recipients of the Program a copy of this License
     85along with the Program.
     86
     87You may charge a fee for the physical act of transferring a copy, and
     88you may at your option offer warranty protection in exchange for a fee.
     89
     90  2. You may modify your copy or copies of the Program or any portion
     91of it, thus forming a work based on the Program, and copy and
     92distribute such modifications or work under the terms of Section 1
     93above, provided that you also meet all of these conditions:
     94
     95    a) You must cause the modified files to carry prominent notices
     96    stating that you changed the files and the date of any change.
     97
     98    b) You must cause any work that you distribute or publish, that in
     99    whole or in part contains or is derived from the Program or any
     100    part thereof, to be licensed as a whole at no charge to all third
     101    parties under the terms of this License.
     102
     103    c) If the modified program normally reads commands interactively
     104    when run, you must cause it, when started running for such
     105    interactive use in the most ordinary way, to print or display an
     106    announcement including an appropriate copyright notice and a
     107    notice that there is no warranty (or else, saying that you provide
     108    a warranty) and that users may redistribute the program under
     109    these conditions, and telling the user how to view a copy of this
     110    License.  (Exception: if the Program itself is interactive but
     111    does not normally print such an announcement, your work based on
     112    the Program is not required to print an announcement.)
     113
     114These requirements apply to the modified work as a whole.  If
     115identifiable sections of that work are not derived from the Program,
     116and can be reasonably considered independent and separate works in
     117themselves, then this License, and its terms, do not apply to those
     118sections when you distribute them as separate works.  But when you
     119distribute the same sections as part of a whole which is a work based
     120on the Program, the distribution of the whole must be on the terms of
     121this License, whose permissions for other licensees extend to the
     122entire whole, and thus to each and every part regardless of who wrote it.
     123
     124Thus, it is not the intent of this section to claim rights or contest
     125your rights to work written entirely by you; rather, the intent is to
     126exercise the right to control the distribution of derivative or
     127collective works based on the Program.
     128
     129In addition, mere aggregation of another work not based on the Program
     130with the Program (or with a work based on the Program) on a volume of
     131a storage or distribution medium does not bring the other work under
     132the scope of this License.
     133
     134  3. You may copy and distribute the Program (or a work based on it,
     135under Section 2) in object code or executable form under the terms of
     136Sections 1 and 2 above provided that you also do one of the following:
     137
     138    a) Accompany it with the complete corresponding machine-readable
     139    source code, which must be distributed under the terms of Sections
     140    1 and 2 above on a medium customarily used for software interchange; or,
     141
     142    b) Accompany it with a written offer, valid for at least three
     143    years, to give any third party, for a charge no more than your
     144    cost of physically performing source distribution, a complete
     145    machine-readable copy of the corresponding source code, to be
     146    distributed under the terms of Sections 1 and 2 above on a medium
     147    customarily used for software interchange; or,
     148
     149    c) Accompany it with the information you received as to the offer
     150    to distribute corresponding source code.  (This alternative is
     151    allowed only for noncommercial distribution and only if you
     152    received the program in object code or executable form with such
     153    an offer, in accord with Subsection b above.)
     154
     155The source code for a work means the preferred form of the work for
     156making modifications to it.  For an executable work, complete source
     157code means all the source code for all modules it contains, plus any
     158associated interface definition files, plus the scripts used to
     159control compilation and installation of the executable.  However, as a
     160special exception, the source code distributed need not include
     161anything that is normally distributed (in either source or binary
     162form) with the major components (compiler, kernel, and so on) of the
     163operating system on which the executable runs, unless that component
     164itself accompanies the executable.
     165
     166If distribution of executable or object code is made by offering
     167access to copy from a designated place, then offering equivalent
     168access to copy the source code from the same place counts as
     169distribution of the source code, even though third parties are not
     170compelled to copy the source along with the object code.
     171
     172  4. You may not copy, modify, sublicense, or distribute the Program
     173except as expressly provided under this License.  Any attempt
     174otherwise to copy, modify, sublicense or distribute the Program is
     175void, and will automatically terminate your rights under this License.
     176However, parties who have received copies, or rights, from you under
     177this License will not have their licenses terminated so long as such
     178parties remain in full compliance.
     179
     180  5. You are not required to accept this License, since you have not
     181signed it.  However, nothing else grants you permission to modify or
     182distribute the Program or its derivative works.  These actions are
     183prohibited by law if you do not accept this License.  Therefore, by
     184modifying or distributing the Program (or any work based on the
     185Program), you indicate your acceptance of this License to do so, and
     186all its terms and conditions for copying, distributing or modifying
     187the Program or works based on it.
     188
     189  6. Each time you redistribute the Program (or any work based on the
     190Program), the recipient automatically receives a license from the
     191original licensor to copy, distribute or modify the Program subject to
     192these terms and conditions.  You may not impose any further
     193restrictions on the recipients' exercise of the rights granted herein.
     194You are not responsible for enforcing compliance by third parties to
     195this License.
     196
     197  7. If, as a consequence of a court judgment or allegation of patent
     198infringement or for any other reason (not limited to patent issues),
     199conditions are imposed on you (whether by court order, agreement or
     200otherwise) that contradict the conditions of this License, they do not
     201excuse you from the conditions of this License.  If you cannot
     202distribute so as to satisfy simultaneously your obligations under this
     203License and any other pertinent obligations, then as a consequence you
     204may not distribute the Program at all.  For example, if a patent
     205license would not permit royalty-free redistribution of the Program by
     206all those who receive copies directly or indirectly through you, then
     207the only way you could satisfy both it and this License would be to
     208refrain entirely from distribution of the Program.
     209
     210If any portion of this section is held invalid or unenforceable under
     211any particular circumstance, the balance of the section is intended to
     212apply and the section as a whole is intended to apply in other
     213circumstances.
     214
     215It is not the purpose of this section to induce you to infringe any
     216patents or other property right claims or to contest validity of any
     217such claims; this section has the sole purpose of protecting the
     218integrity of the free software distribution system, which is
     219implemented by public license practices.  Many people have made
     220generous contributions to the wide range of software distributed
     221through that system in reliance on consistent application of that
     222system; it is up to the author/donor to decide if he or she is willing
     223to distribute software through any other system and a licensee cannot
     224impose that choice.
     225
     226This section is intended to make thoroughly clear what is believed to
     227be a consequence of the rest of this License.
     228
     229  8. If the distribution and/or use of the Program is restricted in
     230certain countries either by patents or by copyrighted interfaces, the
     231original copyright holder who places the Program under this License
     232may add an explicit geographical distribution limitation excluding
     233those countries, so that distribution is permitted only in or among
     234countries not thus excluded.  In such case, this License incorporates
     235the limitation as if written in the body of this License.
     236
     237  9. The Free Software Foundation may publish revised and/or new versions
     238of the General Public License from time to time.  Such new versions will
     239be similar in spirit to the present version, but may differ in detail to
     240address new problems or concerns.
     241
     242Each version is given a distinguishing version number.  If the Program
     243specifies a version number of this License which applies to it and "any
     244later version", you have the option of following the terms and conditions
     245either of that version or of any later version published by the Free
     246Software Foundation.  If the Program does not specify a version number of
     247this License, you may choose any version ever published by the Free Software
     248Foundation.
     249
     250  10. If you wish to incorporate parts of the Program into other free
     251programs whose distribution conditions are different, write to the author
     252to ask for permission.  For software which is copyrighted by the Free
     253Software Foundation, write to the Free Software Foundation; we sometimes
     254make exceptions for this.  Our decision will be guided by the two goals
     255of preserving the free status of all derivatives of our free software and
     256of promoting the sharing and reuse of software generally.
     257
     258                            NO WARRANTY
     259
     260  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
     261FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
     262OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
     263PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
     264OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     265MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
     266TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
     267PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
     268REPAIR OR CORRECTION.
     269
     270  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
     271WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
     272REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
     273INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
     274OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
     275TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
     276YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
     277PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
     278POSSIBILITY OF SUCH DAMAGES.
     279
     280                     END OF TERMS AND CONDITIONS
     281
     282            How to Apply These Terms to Your New Programs
     283
     284  If you develop a new program, and you want it to be of the greatest
     285possible use to the public, the best way to achieve this is to make it
     286free software which everyone can redistribute and change under these terms.
     287
     288  To do so, attach the following notices to the program.  It is safest
     289to attach them to the start of each source file to most effectively
     290convey the exclusion of warranty; and each file should have at least
     291the "copyright" line and a pointer to where the full notice is found.
     292
     293    <one line to give the program's name and a brief idea of what it does.>
     294    Copyright (C) <year>  <name of author>
     295
     296    This program is free software; you can redistribute it and/or modify
     297    it under the terms of the GNU General Public License as published by
     298    the Free Software Foundation; either version 2 of the License, or
     299    (at your option) any later version.
     300
     301    This program is distributed in the hope that it will be useful,
     302    but WITHOUT ANY WARRANTY; without even the implied warranty of
     303    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     304    GNU General Public License for more details.
     305
     306    You should have received a copy of the GNU General Public License along
     307    with this program; if not, write to the Free Software Foundation, Inc.,
     308    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
     309
     310Also add information on how to contact you by electronic and paper mail.
     311
     312If the program is interactive, make it output a short notice like this
     313when it starts in an interactive mode:
     314
     315    Gnomovision version 69, Copyright (C) year name of author
     316    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
     317    This is free software, and you are welcome to redistribute it
     318    under certain conditions; type `show c' for details.
     319
     320The hypothetical commands `show w' and `show c' should show the appropriate
     321parts of the General Public License.  Of course, the commands you use may
     322be called something other than `show w' and `show c'; they could even be
     323mouse-clicks or menu items--whatever suits your program.
     324
     325You should also get your employer (if you work as a programmer) or your
     326school, if any, to sign a "copyright disclaimer" for the program, if
     327necessary.  Here is a sample; alter the names:
     328
     329  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
     330  `Gnomovision' (which makes passes at compilers) written by James Hacker.
     331
     332  <signature of Ty Coon>, 1 April 1989
     333  Ty Coon, President of Vice
     334
     335This General Public License does not permit incorporating your program into
     336proprietary programs.  If your program is a subroutine library, you may
     337consider it more useful to permit linking proprietary applications with the
     338library.  If this is what you want to do, use the GNU Lesser General
     339Public License instead of this License.
  • custom-site-logo/trunk/custom-site-logo.php

    r2716421 r2917889  
    11<?php
    2 /*
    3 Plugin Name: Custom Site Logo
    4 Plugin URI:  https://no-site.com
    5 Description: This is a plugin to show the custom logo in site header or any where.
    6 Author: Awais Altaf
    7 Author URI: https://no-site.com
    8 Version: 1.0.0
    9 Text Domain: csl_custom_site_logo
    10 License: GNU General Public License v2 or later
    11 License URI: http://www.gnu.org/licenses/gpl-2.0.html
    12 Domain Path: /languages
    13 */
    14 /*
    15 Custom Site Logo is free software: you can redistribute it and/or modify
    16 it under the terms of the GNU General Public License as published by
    17 the Free Software Foundation, either version 2 of the License, or
    18 any later version.
    19  
    20 Custom Site Logo is distributed in the hope that it will be useful,
    21 but WITHOUT ANY WARRANTY; without even the implied warranty of
    22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    23 GNU General Public License for more details.
    24  
    25 You should have received a copy of the GNU General Public License
    26 along with Custom Site Logo. If not, see http://www.gnu.org/licenses/gpl-2.0.html.
    27 */
     2
     3/**
     4 * The plugin bootstrap file
     5 *
     6 * This file is read by WordPress to generate the plugin information in the plugin
     7 * admin area. This file also includes all of the dependencies used by the plugin,
     8 * registers the activation and deactivation functions, and defines a function
     9 * that starts the plugin.
     10 *
     11 * @link              https://no-site.com
     12 * @since             1.0.1
     13 * @package           Custom_Site_Logo
     14 *
     15 * @wordpress-plugin
     16 * Plugin Name:       Custom Site Logo
     17 * Plugin URI:        https://no-site.com
     18 * Description:       This is a plugin to show the custom logo in the site header or anywhere.
     19 * Version:           1.0.0
     20 * Author:            Awais Altaf
     21 * Author URI:        https://no-site.com
     22 * License:           GPL-2.0+
     23 * License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
     24 * Text Domain:       custom-site-logo
     25 * Domain Path:       /languages
     26 */
    2827
    2928// If this file is called directly, abort.
    30 if (!defined('WPINC')) {
    31     die;
     29if ( ! defined( 'WPINC' ) ) {
     30    die;
    3231}
    3332
    34 load_plugin_textdomain(
    35     'csl_custom_site_logo' , false,dirname(plugin_basename(__FILE__)) . '/languages/'
    36 );
     33/**
     34 * Currently plugin version.
     35 * Start at version 1.0.0 and use SemVer - https://semver.org
     36 * Rename this for your plugin and update it as you release new versions.
     37 */
     38define( 'CUSTOM_SITE_LOGO_VERSION', '1.0.0' );
    3739
    38 /* Register Settings with Section */
    39 add_action( 'admin_init', 'csl_CustomSiteLogo_init_settings' );
    40 function csl_CustomSiteLogo_init_settings(){
    41     /* Register General Settings */
    42     register_setting( 'csl_custom_site_logo', 'csl_CustomSiteLogo_option_name' );
     40/**
     41 * The code that runs during plugin activation.
     42 * This action is documented in includes/class-custom-site-logo-activator.php
     43 */
     44function activate_custom_site_logo() {
     45    require_once plugin_dir_path( __FILE__ ) . 'includes/class-custom-site-logo-activator.php';
     46    Custom_Site_Logo_Activator::activate();
     47}
    4348
    44     // register a new section in the "wporg" page
    45      add_settings_section(
    46          'csl_CustomSiteLogo_section_developers',
    47          __( 'Custom Site Logo Settings', 'csl_custom_site_logo' ),  /* WordPress Function To Translate String  */
    48          'csl_CustomSiteLogo_section_developers_function',
    49          'csl_custom_site_logo'
    50      );
     49/**
     50 * The code that runs during plugin deactivation.
     51 * This action is documented in includes/class-custom-site-logo-deactivator.php
     52 */
     53function deactivate_custom_site_logo() {
     54    require_once plugin_dir_path( __FILE__ ) . 'includes/class-custom-site-logo-deactivator.php';
     55    Custom_Site_Logo_Deactivator::deactivate();
     56}
    5157
    52     /* Logo Image Upload Field */
    53      add_settings_field(
    54          'csl_CustomSiteLogo_image_field',
    55          __( 'Upload Image', 'csl_custom_site_logo' ), 
    56          'csl_CustomSiteLogo_image_field_callback_function',
    57          'csl_custom_site_logo',
    58          'csl_CustomSiteLogo_section_developers',
    59          [
    60          'label_for' => 'csl_CustomSiteLogo_image_field',
    61          'class' => 'csl_CustomSiteLogo_row_image',
    62          ]
    63      );
     58register_activation_hook( __FILE__, 'activate_custom_site_logo' );
     59register_deactivation_hook( __FILE__, 'deactivate_custom_site_logo' );
    6460
    65      /* Logo Hover Effect Field */
    66      add_settings_field(
    67          'csl_CustomSiteLogo_hover_effect_field',
    68          __( 'Choose Hover Effect', 'csl_custom_site_logo' ), 
    69          'csl_CustomSiteLogo_hover_effecr_field_callback_function',
    70          'csl_custom_site_logo',
    71          'csl_CustomSiteLogo_section_developers',
    72          [
    73          'label_for' => 'csl_CustomSiteLogo_hover_effect_field',
    74          'class' => 'csl_CustomSiteLogo_row_custom_url',
    75          ]
    76      );
     61/**
     62 * The core plugin class that is used to define internationalization,
     63 * admin-specific hooks, and public-facing site hooks.
     64 */
     65require plugin_dir_path( __FILE__ ) . 'includes/class-custom-site-logo.php';
    7766
    78      /* Logo Width Field */
    79      add_settings_field(
    80          'csl_CustomSiteLogo_width_field',
    81          __( 'Logo Width', 'csl_custom_site_logo' ), 
    82          'csl_CustomSiteLogo_width_field_callback_function',
    83          'csl_custom_site_logo',
    84          'csl_CustomSiteLogo_section_developers',
    85          [
    86          'label_for' => 'csl_CustomSiteLogo_width_field',
    87          'class' => 'csl_CustomSiteLogo_row_width_field',
    88          ]
    89      );
     67/**
     68 * Begins execution of the plugin.
     69 *
     70 * Since everything within the plugin is registered via hooks,
     71 * then kicking off the plugin from this point in the file does
     72 * not affect the page life cycle.
     73 *
     74 * @since    1.0.0
     75 */
     76function run_custom_site_logo() {
    9077
    91      /* Logo Height Field */
    92      add_settings_field(
    93          'csl_CustomSiteLogo_height_field',
    94          __( 'Logo Height', 'csl_custom_site_logo' ), 
    95          'csl_CustomSiteLogo_height_field_callback_function',
    96          'csl_custom_site_logo',
    97          'csl_CustomSiteLogo_section_developers',
    98          [
    99          'label_for' => 'csl_CustomSiteLogo_height_field',
    100          'class' => 'csl_CustomSiteLogo_row_height_field',
    101          ]
    102      );
    103 
    104      /* Logo Image Center Field */
    105      add_settings_field(
    106          'csl_CustomSiteLogo_image_center_field',
    107          __( 'Center Logo', 'csl_custom_site_logo' ), 
    108          'csl_CustomSiteLogo_image_center_field_callback_function',
    109          'csl_custom_site_logo',
    110          'csl_CustomSiteLogo_section_developers',
    111          [
    112          'label_for' => 'csl_CustomSiteLogo_image_center_field',
    113          'class' => 'csl_CustomSiteLogo_row_image_center',
    114          ]
    115      );
    116 
    117      /* Logo Image Responsive Field */
    118      add_settings_field(
    119          'csl_CustomSiteLogo_image_responsive_field',
    120          __( 'Make Logo Responsive', 'csl_custom_site_logo' ), 
    121          'csl_CustomSiteLogo_image_responsive_field_callback_function',
    122          'csl_custom_site_logo',
    123          'csl_CustomSiteLogo_section_developers',
    124          [
    125          'label_for' => 'csl_CustomSiteLogo_image_responsive_field',
    126          'class' => 'csl_CustomSiteLogo_row_image_responsive',
    127          ]
    128      );
    129 
    130      /* Logo Custom URL Link Responsive Field */
    131      add_settings_field(
    132          'csl_CustomSiteLogo_custom_url_field',
    133          __( 'Link logo to custom URL', 'csl_custom_site_logo' ), 
    134          'csl_CustomSiteLogo_custom_url_field_callback_function',
    135          'csl_custom_site_logo',
    136          'csl_CustomSiteLogo_section_developers',
    137          [
    138          'label_for' => 'csl_CustomSiteLogo_custom_url_field',
    139          'class' => 'csl_CustomSiteLogo_row_custom_url',
    140          ]
    141      );
    142 
    143      
     78    $plugin = new Custom_Site_Logo();
     79    $plugin->run();
    14480
    14581}
    146 
    147 /* Settings Section Callback function */
    148 function csl_CustomSiteLogo_section_developers_function( $args ){
    149 ?>  <!-- Setting Section -->
    150     <!-- Use Details -->
    151     <div class="csl-CustomSiteLogo-notice-block">
    152         <?php
    153             _e('Dear user, kindly paste csl_CustomSiteLogo_show_logo(); function in your template where you want to display the logo.<br><br>','csl_custom_site_logo');
    154          ?>
    155 
    156         <?php
    157             _e('Dear user, kindly paste shortcode [csl_display_logo] in your post, page or any editor where you want to display the logo.','csl_custom_site_logo');
    158          ?>
    159 
    160          <br/>
    161          <br/>
    162          <a target="_blank" href="https://feastsolutions.com/product/custom-site-logo-pro/">Click here to check features and upgrade to Pro verison</a>
    163        
    164     </div>
    165 <?php
    166 }
    167 
    168 function csl_CustomSiteLogo_image_field_callback_function( $args ) {
    169     $csl_options = get_option( 'csl_CustomSiteLogo_option_name' );
    170 ?><p>
    171         <input id="csl_CustomSiteLogo_image_button" type="button" value="Media Library" class="button-secondary" />
    172         <input id="csl_CustomSiteLogo_logo_image" class="regular-text code" type="text"
    173         name="csl_CustomSiteLogo_option_name[<?php echo esc_attr($args['label_for']); ?>]"
    174         value="<?php echo !empty($csl_options[esc_attr($args['label_for'])]) ?( esc_attr($csl_options[$args['label_for']]) ):(_e('Select Logo','csl_custom_site_logo')) ;?>">
    175     </p>
    176     <p class="description"><?php _e('Enter an image URL or use an image from media library.','csl_custom_site_logo'); ?></p>
    177 
    178 <?php       
    179        
    180    
    181 }
    182 
    183 /* Settings Width Logo Callback function  */
    184 function csl_CustomSiteLogo_width_field_callback_function( $args ){
    185     $csl_options = get_option( 'csl_CustomSiteLogo_option_name' );
    186 ?>
    187     <input id="csl_CustomSiteLogo_logo_width" class="regular-text code" type="number"
    188     name="csl_CustomSiteLogo_option_name[<?php echo esc_attr($args['label_for']); ?>]"
    189     value="<?php echo !empty($csl_options[esc_attr($args['label_for'])]) ?( esc_attr($csl_options[$args['label_for']]) ):('') ;?>">
    190     <p class="description">
    191         <?php _e('Put width in px. If you want default logo width with just leave it empty.','csl_custom_site_logo'); ?>
    192     </p>
    193 <?php
    194 }
    195 
    196 /* Settings Height Logo Callback function  */
    197 function csl_CustomSiteLogo_height_field_callback_function( $args ){
    198     $csl_options = get_option( 'csl_CustomSiteLogo_option_name' );
    199 ?>
    200     <input id="csl_CustomSiteLogo_logo_width" class="regular-text code" type="number"
    201     name="csl_CustomSiteLogo_option_name[<?php echo esc_attr($args['label_for']); ?>]"
    202     value="<?php echo !empty($csl_options[esc_attr($args['label_for'])]) ?( esc_attr($csl_options[$args['label_for']]) ):('') ;?>">
    203     <p class="description">
    204         <?php _e('Put height in px. If you want default logo height with just leave it empty.','csl_custom_site_logo'); ?>
    205     </p>
    206 <?php
    207 }
    208 
    209 /* Settings Center Logo Callback function */
    210 function csl_CustomSiteLogo_image_center_field_callback_function( $args ){
    211     $csl_options = get_option( 'csl_CustomSiteLogo_option_name' );
    212     $center_logo_option = isset( $csl_options[esc_attr($args['label_for'])] ) ? $csl_options[esc_attr($args['label_for'])] : 0;
    213 ?>
    214     <input type="checkbox" id="<?php echo esc_attr( $args['label_for'] ); ?>"
    215     name="csl_CustomSiteLogo_option_name[<?php echo esc_attr($args['label_for']); ?>]"
    216     value="1" <?php checked($center_logo_option, 1); ?>  />
    217 
    218     <label for="csl_CustomSiteLogo_option_name[<?php echo esc_attr($args['label_for']); ?>]">
    219         <?php _e('Please check if you want to center the logo','csl_custom_site_logo'); ?>
    220     </label>
    221     <p class="description">
    222         <?php _e('Check this option to center the logo.','csl_custom_site_logo'); ?>
    223     </p>
    224 <?php
    225 }
    226 
    227 /* Settings Responsive Logo Callback function */
    228 function csl_CustomSiteLogo_image_responsive_field_callback_function( $args ){
    229     $csl_options = get_option( 'csl_CustomSiteLogo_option_name' );
    230     $responsive_logo_option = isset( $csl_options[esc_attr($args['label_for'])] ) ? $csl_options[esc_attr($args['label_for'])] : 0;
    231 ?>
    232    
    233     <input type="checkbox" id="<?php echo esc_attr( $args['label_for'] ); ?>"  name="csl_CustomSiteLogo_option_name[<?php echo esc_attr($args['label_for']); ?>]"
    234     value="1" <?php checked($responsive_logo_option, 1); ?> />
    235     <label for="csl_CustomSiteLogo_option_name[<?php echo esc_attr($args['label_for']); ?>]">
    236         <?php _e('Please check if you want to make logo responsive','csl_custom_site_logo'); ?>
    237     </label>
    238     <p class="description">
    239         <?php _e('Check this option for responsive logo.', 'csl_custom_site_logo'); ?>
    240     </p>
    241 <?php
    242 }
    243 
    244 
    245 /* Settings Custom URL Logo Callback function */
    246 function csl_CustomSiteLogo_custom_url_field_callback_function( $args ){
    247     $csl_options = get_option( 'csl_CustomSiteLogo_option_name' );
    248 ?>
    249     <input id="csl_CustomSiteLogo_custom_url_responsive_field" class="regular-text code" type="text"
    250         name="csl_CustomSiteLogo_option_name[<?php echo esc_attr($args['label_for']); ?>]"
    251          placeholder="<?php _e('Put custom link here.','csl_custom_site_logo'); ?>"  value="<?php echo !empty($csl_options[esc_attr($args['label_for'])]) ?( esc_attr($csl_options[$args['label_for']]) ): '' ;?>">
    252    
    253     <p class="description">
    254         <?php _e('Put any custom URL.','csl_custom_site_logo'); ?>
    255     </p>
    256     <?php
    257 }
    258 
    259 function csl_CustomSiteLogo_hover_effecr_field_callback_function( $args ){
    260     $csl_options = get_option( 'csl_CustomSiteLogo_option_name' );
    261 ?>
    262     <p>
    263         <select id="csl_CustomSiteLogo_hover_effect" name="csl_CustomSiteLogo_option_name[<?php echo esc_attr($args['label_for']); ?>]">
    264             <option value="none" <?php selected($csl_options[$args['label_for']], 'none'); ?>>None</option>
    265             <option value="hvr-grow" <?php selected($csl_options[$args['label_for']], 'hvr-grow'); ?>>Grow</option>
    266             <option value="hvr-shrink" <?php selected($csl_options[$args['label_for']], 'hvr-shrink'); ?>>Shrink</option>
    267             <option value="hvr-push" <?php selected($csl_options[$args['label_for']], 'hvr-push'); ?>>Push</option>
    268             <option value="hvr-pop" <?php selected($csl_options[$args['label_for']], 'hvr-pop'); ?>>Pop</option>
    269             <option value="hvr-rotate" <?php selected($csl_options[$args['label_for']], 'hvr-rotate'); ?>>Rotate</option>
    270             <option value="hvr-grow-rotate" <?php selected($csl_options[$args['label_for']], 'hvr-grow-rotate'); ?>>Grow Rotate</option>
    271             <option value="hvr-float" <?php selected($csl_options[$args['label_for']], 'hvr-float'); ?>>Float</option>
    272             <option value="hvr-sink" <?php selected($csl_options[$args['label_for']], 'hvr-sink'); ?>>Sink</option>
    273             <option value="hvr-skew" <?php selected($csl_options[$args['label_for']], 'hvr-skew'); ?>>Skew</option>
    274             <option value="hvr-skew-forward" <?php  selected($csl_options[$args['label_for']], 'hvr-skew-forward'); ?>>Skew Forward</option>
    275             <option value="hvr-skew-backward" <?php  selected($csl_options[$args['label_for']], 'hvr-skew-backward'); ?>>Skew Backward</option>
    276             <option value="hvr-wobble-horizontal" <?php  selected($csl_options[$args['label_for']], 'hvr-wobble-horizontal'); ?>>Wobble Horizontal</option>
    277             <option value="hvr-wobble-vertical" <?php  selected($csl_options[$args['label_for']], 'hvr-wobble-vertical'); ?>>Wobble Vertical</option>
    278             <option value="hvr-wobble-to-bottom-right" <?php  selected($csl_options[$args['label_for']], 'hvr-wobble-to-bottom-right'); ?>>Wobble to bottom right</option>
    279             <option value="hvr-wobble-to-top-right" <?php  selected($csl_options[$args['label_for']], 'hvr-wobble-to-top-right'); ?>>Wobble to top right</option>
    280             <option value="hvr-wobble-top" <?php  selected($csl_options[$args['label_for']], 'hvr-wobble-top'); ?>>Wobble Top</option>
    281             <option value="hvr-wobble-bottom" <?php  selected($csl_options[$args['label_for']], 'hvr-wobble-bottom'); ?>>Wobble Bottom</option>
    282             <option value="hvr-wobble-skew" <?php  selected($csl_options[$args['label_for']], 'hvr-wobble-skew'); ?>>Wobble Skew</option>
    283             <option value="hvr-buzz" <?php  selected($csl_options[$args['label_for']], 'hvr-buzz'); ?>>Buzz</option>
    284             <option value="hvr-buzz-out" <?php  selected($csl_options[$args['label_for']], 'hvr-buzz-out'); ?>>Buzz Out</option>
    285                         <option value="rotate-csl" <?php  selected($csl_options[$args['label_for']], 'rotate-csl'); ?>>Rotate</option>
    286         </select>
    287     </p>
    288 
    289 
    290 <div class="csl-preview-blocks" <?php  if(isset($csl_options['csl_CustomSiteLogo_image_field']) && ($csl_options['csl_CustomSiteLogo_image_field'] != 'Select Logo')){  }else{ echo 'style=display:none;'; } ?>>
    291     <p id="csl-margi-btm"><strong><?php _e('Check logo preview with hover effect if selected','csl_custom_site_logo'); ?></strong></p>
    292     <img id="csl_CustomSiteLogo_admin_hover_preview" class="<?php echo esc_attr($csl_options['csl_CustomSiteLogo_hover_effect_field']); ?>"
    293     src="<?php echo esc_attr($csl_options['csl_CustomSiteLogo_image_field']); ?>" alt="Logo" />
    294     <p class="description"><?php _e('Select best hover effects','csl_custom_site_logo'); ?></p>
    295 </div>
    296 
    297 <div class="csl-error-logo-url">
    298     <p><?php _e('No Preview Available','csl_custom_site_logo'); ?></p>
    299 </div>
    300 <?php
    301 
    302 }
    303 
    304 /* Check Logo URL */
    305 function csl_CustomSiteLogo_check_logo_url( $csl_logo_url ){
    306     if(isset($csl_logo_url)){
    307         $csl_logo_url = parse_url($csl_logo_url);
    308         if($csl_logo_url['scheme'] == 'https' || $csl_logo_url['scheme'] == 'http'){
    309             return true;
    310         }else{
    311             return false;
    312         }
    313     }else{
    314         return false;
    315     }
    316    
    317 }
    318 
    319 /* Adding Admin Page */
    320 add_action('admin_menu', 'csl_CustomSiteLogo_add_menu_page');
    321 function csl_CustomSiteLogo_add_menu_page()
    322 {
    323     add_submenu_page(
    324         'themes.php', /* Adding this submenu to Settings Main Menu */
    325         __('Custom Site Logo','csl_custom_site_logo'),
    326         __('Custom Site Logo','csl_custom_site_logo'),
    327         'manage_options',
    328         'csl_custom_site_logo',
    329         'csl_CustomSiteLogo_submenu_callback_function'
    330     );
    331 }
    332 
    333 /* Admin Page Callback Function */
    334 function csl_CustomSiteLogo_submenu_callback_function(){
    335     /* Check user capability */
    336     if ( ! current_user_can( 'manage_options' ) ) {
    337         return;
    338     }
    339     /* wordpress will add the "settings-updated" $_GET parameter to the url */
    340     if ( isset( $_GET['settings-updated'] ) ) {
    341     // add settings saved message with the class of "updated"
    342         add_settings_error( 'csl_CustomSiteLogo_messages', 'csl_CustomSiteLogo_message', __( 'Logo Settings Saved Successfully', 'csl_custom_site_logo' ), 'updated' );
    343 ?>
    344     <div id="message" class="updated">
    345     <p><strong><?php _e('Settings Saved Successfully.') ?></strong></p>
    346     </div>
    347 <?php   
    348     }
    349      
    350     ?>
    351   <div class="wrap">
    352     <form action="options.php" method="post" class="csl_CustomSiteLogo_form" >
    353     <!-- Display Settings Here -->
    354     <?php
    355 
    356          // output security fields for the registered setting "csl_custom_site_logo"
    357          settings_fields( 'csl_custom_site_logo' );
    358          
    359          // output setting sections and their fields
    360          do_settings_sections( 'csl_custom_site_logo' );
    361          
    362          // output save settings button
    363          submit_button( 'Save Settings' );
    364 
    365     ?>
    366 
    367    </form>
    368   </div><!-- wrap -->
    369   <?php
    370 }
    371 
    372 
    373 /* Building Shortcode */
    374 function csl_CustomSiteLogo_shortcodes_init(){
    375     function csl_CustomSiteLogo_show_logo(){
    376         /* Get Options */
    377         $get_csl_options  = get_option('csl_CustomSiteLogo_option_name');
    378 
    379         /* Assign Option Values */
    380         $csl_image_field = $get_csl_options['csl_CustomSiteLogo_image_field'];
    381         $csl_image_url = $get_csl_options['csl_CustomSiteLogo_custom_url_field'];
    382         $csl_option_width = $get_csl_options['csl_CustomSiteLogo_width_field'];
    383         $csl_option_height = $get_csl_options['csl_CustomSiteLogo_height_field'];
    384         $csl_option_responsive = isset( $get_csl_options['csl_CustomSiteLogo_image_responsive_field'] ) ? $get_csl_options['csl_CustomSiteLogo_image_responsive_field'] : 0;
    385         $csl_option_hover = $get_csl_options['csl_CustomSiteLogo_hover_effect_field'];
    386         $csl_option_center = isset( $get_csl_options['csl_CustomSiteLogo_image_center_field'] ) ? $get_csl_options['csl_CustomSiteLogo_image_center_field'] : 0;
    387 
    388         if(isset($csl_image_field) && !empty($csl_image_field)){
    389 ?>
    390         <div class="csl-logo-block" style="<?php if($csl_option_center == 1){ echo esc_attr(('text-align:center')); } ?>">
    391             <a id="csl-logo-block-link" href="<?php if(!empty($csl_image_url)){ echo esc_url($csl_image_url); }else{ echo esc_attr("#"); } ?>">
    392                 <img id="csl-customsite-logo" class="csl-customsite-logo <?php echo esc_attr($csl_option_hover); ?>"
    393                 src="<?php echo esc_url($csl_image_field); ?>" style=" <?php if(!empty($csl_option_width)){ echo esc_attr('width:'.$csl_option_width.'px;'); } ?>
    394                 <?php if(!empty($csl_option_height)){ echo esc_attr('height:'.$csl_option_height.'px;'); } ?>
    395                     <?php if($csl_option_responsive == 1){  echo esc_attr('width:100%;max-width:100%;height:auto;'); } ?>" />
    396             </a>
    397         </div><!-- csl-logo-block Ends -->
    398 <?php
    399         }else{
    400 ?>
    401         <div class="csl-error">Error! No Logo Upload. Please upload logo : <strong>(Dashboard => Appearence => Custom Site Logo)</strong></div>
    402 <?php
    403         }
    404     }
    405     add_shortcode("csl_display_logo","csl_CustomSiteLogo_show_logo");
    406 }
    407 add_action('init', 'csl_CustomSiteLogo_shortcodes_init');
    408 
    409 /* Enqueuing Admin Scripts and Styles */
    410 function csl_CustomSiteLogo_admin_modal_js()
    411 {
    412     // Enqueue the JS & CSS:
    413     wp_enqueue_media(); // Fixing media library button
    414     wp_enqueue_style( 'thickbox' );
    415     wp_enqueue_style('csl_CustomSiteLogo_admin_css', plugins_url( 'assets/css/custom-site-logo-admin.css', __FILE__ ), array(),'1.0', 'all');
    416     wp_enqueue_style('csl_CustomSiteLogo_admin_hover_css', plugins_url( 'assets/css/hover-css/hover-min.css', __FILE__ ), array(),'1.0', 'all');
    417     wp_enqueue_script('csl_CustomSiteLogo_admin_js', plugins_url( 'assets/js/custom-site-logo-admin.js', __FILE__ ), array('jquery', 'media-upload', 'thickbox'),'1.0', true);
    418 }
    419 add_action( 'admin_enqueue_scripts', 'csl_CustomSiteLogo_admin_modal_js');
    420 
    421 /* Enqueuing Frontend Styles */
    422 function csl_CustomSiteLogo_front_css()
    423 {
    424     // Enqueue the styles:
    425     wp_enqueue_style('csl_CustomSiteLogo_front_hover_css', plugins_url( 'assets/css/hover-css/hover-min.css', __FILE__ ), array(),'1.0', 'all');
    426     wp_enqueue_style('csl_CustomSiteLogo_front_css', plugins_url( 'assets/css/custom-site-logo-front.css', __FILE__ ), array(),'1.0', 'all');
    427 
    428 }
    429 add_action( 'wp_enqueue_scripts', 'csl_CustomSiteLogo_front_css');
    430 
    431 add_filter('plugin_action_links', 'csl_CustomSiteLogo_add_action_plugin', 10, 5);
    432 
    433 /* Custom Site Logo action links */
    434 function csl_CustomSiteLogo_add_action_plugin($actions, $plugin_file)
    435 {
    436     static $plugin;
    437     if (!isset($plugin))
    438     $plugin = plugin_basename(__FILE__);
    439     if ($plugin == $plugin_file) {
    440     $settings   = array('settings'  => '<a href="admin.php?page=csl_custom_site_logo">' . __('Settings', 'General') . '</a>');
    441     $actions = array_merge($settings, $actions);
    442     }
    443     return $actions;
    444 }   
    445 
     82run_custom_site_logo();
  • custom-site-logo/trunk/readme.txt

    r2716407 r2917889  
    33Tags: logo, center logo, logo management, effects, custom logo
    44Requires at least: 3.0
    5 Tested up to: 5.8
    6 Stable tag: 1.0.1
     5Tested up to: 6.2
     6Stable tag: 1.0.0
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • custom-site-logo/trunk/uninstall.php

    r1682917 r2917889  
    11<?php
    2 /* Uninstall File IT Popup */
    32
    4 if (!defined('WP_UNINSTALL_PLUGIN')) {
    5     die;
     3/**
     4 * Fired when the plugin is uninstalled.
     5 *
     6 * When populating this file, consider the following flow
     7 * of control:
     8 *
     9 * - This method should be static
     10 * - Check if the $_REQUEST content actually is the plugin name
     11 * - Run an admin referrer check to make sure it goes through authentication
     12 * - Verify the output of $_GET makes sense
     13 * - Repeat with other user roles. Best directly by using the links/query string parameters.
     14 * - Repeat things for multisite. Once for a single site in the network, once sitewide.
     15 *
     16 * This file may be updated more in future version of the Boilerplate; however, this is the
     17 * general skeleton and outline for how the file should work.
     18 *
     19 * For more information, see the following discussion:
     20 * https://github.com/tommcfarlin/WordPress-Plugin-Boilerplate/pull/123#issuecomment-28541913
     21 *
     22 * @link       https://no-site.com
     23 * @since      1.0.0
     24 *
     25 * @package    Custom_Site_Logo
     26 */
     27
     28// If uninstall not called from WordPress, then exit.
     29if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
     30    exit;
    631}
    7  
    8 /* Deleting Options */
    9 delete_option('csl_CustomSiteLogo_option_name');
    10 
    11 ?>
Note: See TracChangeset for help on using the changeset viewer.